Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BitSail][Feature] Support byte in type system #382

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,19 @@ public Object convert(Schema schema, Object object) {
return ((Short) object).intValue();
}
};
} else if (BasicTypeInfo.BOOLEAN_TYPE_INFO.getTypeClass().equals(typeClass) || BasicTypeInfo.INT_TYPE_INFO.getTypeClass().equals(typeClass) ||
}
else if (BasicTypeInfo.BYTE_TYPE_INFO.getTypeClass().equals(typeClass)) {
converter =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We define check style in tools/maven/checkstyle.xml, and unfortunately it's not satisfied here.
You can reference this page to see if checkstyle is satisfied in IDEA.

new RowToAvroConverter() {
private static final long serialVersionUID = 1L;

@Override
public Object convert(Schema schema, Object object) {
return Integer.valueOf(Long.toString((Long) object));
}
};
}
else if (BasicTypeInfo.BOOLEAN_TYPE_INFO.getTypeClass().equals(typeClass) || BasicTypeInfo.INT_TYPE_INFO.getTypeClass().equals(typeClass) ||
BasicTypeInfo.LONG_TYPE_INFO.getTypeClass().equals(typeClass) || BasicTypeInfo.FLOAT_TYPE_INFO.getTypeClass().equals(typeClass) ||
BasicTypeInfo.DOUBLE_TYPE_INFO.getTypeClass().equals(typeClass) || SqlTimeTypeInfo.TIME.getTypeClass().equals(typeClass) ||
SqlTimeTypeInfo.DATE.getTypeClass().equals(typeClass) || SqlTimeTypeInfo.TIMESTAMP.getTypeClass().equals(typeClass)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ private static DataType baseType2DataType(String type) {
case "tinyint":
case "int":
return DataTypes.INT();
case "byte":
return DataTypes.TINYINT();
case "long":
case "bigint":
return DataTypes.BIGINT();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class Fake2HudiITCase {
private static final Logger LOG = LoggerFactory.getLogger(Fake2HudiITCase.class);
private static final String TEST_SCHEMA =
"[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"string\"}]";
"[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"age\",\"type\":\"byte\"},{\"name\":\"timestamp\",\"type\":\"string\"}]";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the ITCase test will fail because byte type is not supported in com.bytedance.bitsail.connector.legacy.fake.source.FakeSource.
So I suggest focusing on FakeSource because it is a basic connenctor and widely used in various tests, and the modification to hudi connector can be ignored.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, will update PR accordingly


private static final String WRITER_PREFIX = "job.writer.";
@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class TypeInfoColumnBridge {
PrimitiveColumnTypeInfo.LONG_COLUMN_TYPE_INFO);
COLUMN_BRIDGE_TYPE_INFO_MAPPING.put(TypeInfos.LONG_TYPE_INFO,
PrimitiveColumnTypeInfo.LONG_COLUMN_TYPE_INFO);
COLUMN_BRIDGE_TYPE_INFO_MAPPING.put(TypeInfos.BYTE_TYPE_INFO,
PrimitiveColumnTypeInfo.LONG_COLUMN_TYPE_INFO);
COLUMN_BRIDGE_TYPE_INFO_MAPPING.put(TypeInfos.BIG_INTEGER_TYPE_INFO,
PrimitiveColumnTypeInfo.LONG_COLUMN_TYPE_INFO);

Expand Down