org.talend.daikon.avro.AvroUtils._long()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.talend.daikon.avro.AvroUtils._long()方法的一些代码示例,展示了AvroUtils._long()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AvroUtils._long()方法的具体详情如下:
包路径:org.talend.daikon.avro.AvroUtils
类名称:AvroUtils
方法名:_long

AvroUtils._long介绍

暂无

代码示例

代码示例来源:origin: org.talend.components/bigquery-runtime

@Override
public org.apache.avro.Schema getSchema() {
  return AvroUtils._long();
}

代码示例来源:origin: Talend/components

@Override
public org.apache.avro.Schema getSchema() {
  return AvroUtils._long();
}

代码示例来源:origin: Talend/components

/**
 * Checks {@link TalendType#convertFromAvro(Schema)} converts long avro type to "id_Long" di type
 */
@Test
public void testConvertFromAvroLong() {
  TalendType expectedType = TalendType.LONG;
  Schema fieldSchema = AvroUtils._long();
  assertEquals(expectedType, TalendType.convertFromAvro(fieldSchema));
}

代码示例来源:origin: Talend/components

/**
 * Checks {@link AvroTypeConverter#convertToAvro(String, String)} returns Long avro schema in case TalendType.LONG Talend type
 * is
 * passed
 */
@Test
public void testConvertToAvroLong() {
  Schema expectedSchema = AvroUtils._long();
  assertEquals(expectedSchema, AvroTypeConverter.convertToAvro(TalendType.LONG, null));
}

代码示例来源:origin: org.talend.components/processing-runtime

return AvroUtils._long();
case SUM:
  if (AvroUtils.isSameType(fieldType, AvroUtils._int())) {
    return AvroUtils._long();
  } else if (AvroUtils.isSameType(fieldType, AvroUtils._float())) {
    return AvroUtils._double();

代码示例来源:origin: Talend/components

return AvroUtils._long();
case SUM:
  if (AvroUtils.isSameType(fieldType, AvroUtils._int())) {
    return AvroUtils._long();
  } else if (AvroUtils.isSameType(fieldType, AvroUtils._float())) {
    return AvroUtils._double();

代码示例来源:origin: Talend/components

public static Schema getEventSchema() {
  Schema.Field[] fields = new Schema.Field[10];
  Schema.Field field;
  fields[EventSchemaField.EVENT_IDX] = new Schema.Field("event", AvroUtils._string(), "Type of event", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.PARTITION_IDX] = new Schema.Field("partition", AvroUtils._short(), "Partition number", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.KEY_IDX] = new Schema.Field("key", AvroUtils._string(), "Key", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.CAS_IDX] = new Schema.Field("cas", AvroUtils._long(), "CAS", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.SEQNO_IDX] = new Schema.Field("bySeqno", AvroUtils._long(), "Sequence number", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.REV_SEQNO_IDX] = new Schema.Field("revSeqno", AvroUtils._long(), "Revision sequence number", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.EXPIRATION_IDX] = new Schema.Field("expiration", AvroUtils.wrapAsNullable(AvroUtils._int()), "Expiration", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.FLAGS_IDX] = new Schema.Field("flags", AvroUtils.wrapAsNullable(AvroUtils._int()), "Flags", (Object) null, Schema.Field.Order.ASCENDING);
  fields[EventSchemaField.LOCK_TIME_IDX] = new Schema.Field("lockTime", AvroUtils.wrapAsNullable(AvroUtils._int()), "Lock time", (Object) null, Schema.Field.Order.ASCENDING);
  field = new Schema.Field("content", AvroUtils.wrapAsNullable(AvroUtils._bytes()), "Content", (Object) null, Schema.Field.Order.ASCENDING);
  field.addProp(TALEND_IS_LOCKED, "false");
  fields[EventSchemaField.CONTENT_IDX] = field;
  Schema schema = Schema.createRecord("DcpMessage", "Couchbase DCP message", "com.couchbase",
      false, Arrays.asList(fields));
  schema.addProp(TALEND_IS_LOCKED, "true");
  return schema;
}

代码示例来源:origin: org.talend.components/components-jdbc-runtime

return AvroUtils._int();
case LONG:
  return AvroUtils._long();
case DOUBLE:
  return AvroUtils._double();

代码示例来源:origin: Talend/components

return AvroUtils._int();
case LONG:
  return AvroUtils._long();
case DOUBLE:
  return AvroUtils._double();

代码示例来源:origin: org.talend.daikon/daikon

/**
 * Get an Avro schema using {@link AvroUtils#wrapAsNullable(Schema)} by node type.
 * 
 * @param node Json node.
 * @return an Avro schema using {@link AvroUtils#wrapAsNullable(Schema)} by node type.
 */
@VisibleForTesting
Schema getAvroSchema(JsonNode node) {
  if (node instanceof TextNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._string());
  } else if (node instanceof IntNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._int());
  } else if (node instanceof LongNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._long());
  } else if (node instanceof DoubleNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._double());
  } else if (node instanceof BooleanNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._boolean());
  } else if (node instanceof NullNode) {
    return AvroUtils.wrapAsNullable(AvroUtils._string());
  } else {
    return createSubRecord(node);
  }
}

代码示例来源:origin: org.talend.components/processing-runtime

case SUM:
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())
      || AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new SumLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())) {
    return new MinIntegerAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new MinLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())) {
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())) {
    return new MaxIntegerAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new MaxLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())) {

代码示例来源:origin: Talend/components

case SUM:
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())
      || AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new SumLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())) {
    return new MinIntegerAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new MinLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())) {
  if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._int())) {
    return new MaxIntegerAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._long())) {
    return new MaxLongAccumulatorFn();
  } else if (AvroUtils.isSameType(inputFieldSchema, AvroUtils._float())) {

代码示例来源:origin: org.talend.components/components-salesforce-runtime

} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._short())) {
  return new StringToShortConverter(f);
} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._long())) {
  return new StringToLongConverter(f);
} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._date())) {

代码示例来源:origin: Talend/components

} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._short())) {
  return new StringToShortConverter(f);
} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._long())) {
  return new StringToLongConverter(f);
} else if (AvroUtils.isSameType(fieldSchema, AvroUtils._date())) {

代码示例来源:origin: Talend/components

public AvroConverter<String, ?> getConverter(Schema.Field f, FileDelimitedProperties properties) {
  Schema fieldSchema = AvroUtils.unwrapIfNullable(f.schema());
  if (AvroUtils.isSameType(fieldSchema, AvroUtils._boolean())) {
    return new BooleanConverter(f);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._decimal())) {
    return new DecimalConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._double())) {
    return new DoubleConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._float())) {
    return new FloatConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._int())) {
    return new IntegerConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._date())) {
    return new DateConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._long())) {
    return new LongConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._bytes())) {
    return new BytesConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._byte())) {
    return new ByteConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._short())) {
    return new ShortConverter(f, properties);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._character())) {
    return new CharacterConverter(f);
  } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._string())) {
    return super.getConverter(String.class);
  }
  throw new UnsupportedOperationException("The type " + fieldSchema.getType() + " is not supported."); //$NON-NLS-1$ //$NON-NLS-2$
}

代码示例来源:origin: org.talend.components/components-jdbc-runtime

} else if (AvroUtils.isSameType(basicSchema, AvroUtils._decimal())) {
  return Types.DECIMAL;
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._long())) {
  return Types.BIGINT;
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._double())) {

代码示例来源:origin: Talend/components

} else if (AvroUtils.isSameType(basicSchema, AvroUtils._decimal())) {
  return Types.DECIMAL;
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._long())) {
  return Types.BIGINT;
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._double())) {

代码示例来源:origin: Talend/components

} else if (AvroUtils.isSameType(basicSchema, AvroUtils._decimal())) {
  writer = new BigDecimalTypeWriter(statement, statementIndex, inputValueLocation);
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._long())) {
  writer = new LongTypeWriter(statement, statementIndex, inputValueLocation);
} else if (AvroUtils.isSameType(basicSchema, AvroUtils._double())) {

代码示例来源:origin: org.talend.components/components-azurestorage

public static DTEConverter createConverter(final Field f, final String mappedName) {
  Schema basicSchema = AvroUtils.unwrapIfNullable(f.schema());
  AzureStorageDTEConverters converters = new AzureStorageDTEConverters();
  DTEConverter dteConverter;
  if (AvroUtils.isSameType(basicSchema, AvroUtils._string()) || AvroUtils.isSameType(basicSchema, AvroUtils._character())) {
    dteConverter = converters.new StringDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._int()) || AvroUtils.isSameType(basicSchema, AvroUtils._short())
      || AvroUtils.isSameType(basicSchema, AvroUtils._byte())) {
    dteConverter = converters.new IntegerDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._date())) {
    dteConverter = converters.new DateDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._decimal())
      || AvroUtils.isSameType(basicSchema, AvroUtils._double())
      || AvroUtils.isSameType(basicSchema, AvroUtils._float())) {
    dteConverter = converters.new DoubleDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._long())) {
    dteConverter = converters.new LongDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._boolean())) {
    dteConverter = converters.new BooleanDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._bytes())) {
    dteConverter = converters.new ByteArrayDTEConverter(mappedName);
  } else {
    dteConverter = converters.new StringDTEConverter(f, mappedName);
  }
  return dteConverter;
}

代码示例来源:origin: Talend/components

public static DTEConverter createConverter(final Field f, final String mappedName) {
  Schema basicSchema = AvroUtils.unwrapIfNullable(f.schema());
  AzureStorageDTEConverters converters = new AzureStorageDTEConverters();
  DTEConverter dteConverter;
  if (AvroUtils.isSameType(basicSchema, AvroUtils._string()) || AvroUtils.isSameType(basicSchema, AvroUtils._character())) {
    dteConverter = converters.new StringDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._int()) || AvroUtils.isSameType(basicSchema, AvroUtils._short())
      || AvroUtils.isSameType(basicSchema, AvroUtils._byte())) {
    dteConverter = converters.new IntegerDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._date())) {
    dteConverter = converters.new DateDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._decimal())
      || AvroUtils.isSameType(basicSchema, AvroUtils._double())
      || AvroUtils.isSameType(basicSchema, AvroUtils._float())) {
    dteConverter = converters.new DoubleDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._long())) {
    dteConverter = converters.new LongDTEConverter(f, mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._boolean())) {
    dteConverter = converters.new BooleanDTEConverter(mappedName);
  } else if (AvroUtils.isSameType(basicSchema, AvroUtils._bytes())) {
    dteConverter = converters.new ByteArrayDTEConverter(mappedName);
  } else {
    dteConverter = converters.new StringDTEConverter(f, mappedName);
  }
  return dteConverter;
}

相关文章