Skip to content

Commit

Permalink
delete long type for now, treat all ints as longs
Browse files Browse the repository at this point in the history
  • Loading branch information
edgao committed Jul 15, 2022
1 parent bcf47c6 commit 018efd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum JsonSchemaType {

STRING("string", true, null, Schema.Type.STRING),
NUMBER_INT("number", true, "integer", Schema.Type.LONG),
NUMBER_LONG("number", true, "long", Schema.Type.STRING),
NUMBER_BIGINT("number", true, "big_integer", Schema.Type.STRING),
NUMBER_FLOAT("number", true, "float", Schema.Type.FLOAT),
NUMBER("number", true, null, Schema.Type.DOUBLE),
INTEGER("integer", true, null, Schema.Type.INT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Schema parseSingleType(final String fieldName,

final Schema fieldSchema;
switch (fieldType) {
case INTEGER, NUMBER, NUMBER_INT, NUMBER_LONG, NUMBER_FLOAT, BOOLEAN -> fieldSchema = Schema.create(fieldType.getAvroType());
case INTEGER, NUMBER, NUMBER_INT, NUMBER_FLOAT, BOOLEAN -> fieldSchema = Schema.create(fieldType.getAvroType());
case STRING -> {
if (fieldDefinition.has("format")) {
final String format = fieldDefinition.get("format").asText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class JsonSchemaTypeTest {

@ParameterizedTest
@ArgumentsSource(JsonSchemaTypeProvider.class)
public void testFromJsonSchemaType(String type, String airbyteType, JsonSchemaType expectedJsonSchemaType) {
public void testFromJsonSchemaType(final String type, final String airbyteType, final JsonSchemaType expectedJsonSchemaType) {
assertEquals(
expectedJsonSchemaType,
JsonSchemaType.fromJsonSchemaType(type, airbyteType));
Expand All @@ -26,10 +26,10 @@ public void testFromJsonSchemaType(String type, String airbyteType, JsonSchemaTy
public static class JsonSchemaTypeProvider implements ArgumentsProvider {

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) throws Exception {
public Stream<? extends Arguments> provideArguments(final ExtensionContext context) throws Exception {
return Stream.of(
Arguments.of("number", "integer", JsonSchemaType.NUMBER_INT),
Arguments.of("number", "big_integer", JsonSchemaType.NUMBER_LONG),
Arguments.of("number", "big_integer", JsonSchemaType.NUMBER_BIGINT),
Arguments.of("number", "float", JsonSchemaType.NUMBER_FLOAT),
Arguments.of("number", null, JsonSchemaType.NUMBER),
Arguments.of("string", null, JsonSchemaType.STRING),
Expand Down

0 comments on commit 018efd4

Please sign in to comment.