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

[Fix][Connector-V2] Field information lost during Paimon DataType and SeaTunnel Column conversion #6767

Merged
merged 16 commits into from
May 23, 2024

Conversation

xiaochen-zhou
Copy link
Contributor

@xiaochen-zhou xiaochen-zhou commented Apr 28, 2024

Purpose of this pull request

Field information lost during Paimon DataType and SeaTunnel Column conversion, such as: field name

Does this PR introduce any user-facing change?
no

How was this patch tested?
exists test

Check list

@Hisoka-X
Copy link
Member

Any test case?

@xiaochen-zhou
Copy link
Contributor Author

Any test case?

Any test case?

OK, thanks for your review. I'm going to add some test cases

@xiaochen-zhou xiaochen-zhou changed the title [Fix][Connector-V2] Field information lost during Paimon and SeaTunnel row type conversion [Fix][Connector-V2] Field information lost during Paimon DataType and SeaTunnel Column conversion May 1, 2024
Copy link
Contributor

@dailai dailai left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -320,7 +321,7 @@ public static SeaTunnelRow convert(InternalRow rowData, SeaTunnelRowType seaTunn
break;
default:
throw new PaimonConnectorException(
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
CommonErrorCode.UNSUPPORTED_DATA_TYPE,
Copy link
Member

Choose a reason for hiding this comment

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

Please throw common error by use this method.

public static SeaTunnelRuntimeException unsupportedDataType(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please throw common error by use this method.

public static SeaTunnelRuntimeException unsupportedDataType(

done.

Comment on lines 93 to 99
public static SeaTunnelRuntimeException unsupportedDataType(
String identifier, String dataType) {
Map<String, String> params = new HashMap<>();
params.put("identifier", identifier);
params.put("dataType", dataType);
return new SeaTunnelRuntimeException(UNSUPPORTED_DATA_TYPE_SIMPLE, params);
}
Copy link
Member

Choose a reason for hiding this comment

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

Please reuse public static SeaTunnelRuntimeException unsupportedDataType( String identifier, String dataType, String field) . Because we should make sure user know which field can not supported.

return new SeaTunnelRuntimeException(UNSUPPORTED_ARRAY_GENERIC_TYPE, params);
}

public static SeaTunnelRuntimeException unsupportedRowKind(String identifier, String rowKind) {
Copy link
Member

Choose a reason for hiding this comment

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

we need tableId when invoke unsupportedRowKind method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need tableId when invoke unsupportedRowKind method.

OK, I will optimize the code based on your suggestions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need tableId when invoke unsupportedRowKind method.

OK, I will optimize the code based on your suggestions

done.

Comment on lines 214 to 220
public static SeaTunnelRuntimeException unsupportedArrayGenericType(
String identifier, String dataType) {
Map<String, String> params = new HashMap<>();
params.put("identifier", identifier);
params.put("dataType", dataType);
return new SeaTunnelRuntimeException(UNSUPPORTED_ARRAY_GENERIC_TYPE, params);
}
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

done.

ClownXC added 6 commits May 12, 2024 09:21
# Conflicts:
#	seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java
#	seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java
@@ -445,9 +496,8 @@ public SeaTunnelDataType<?> visit(RowType rowType) {

@Override
protected SeaTunnelDataType defaultMethod(DataType dataType) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hisoka-X This defaultMethod method inherited from paimon seems to be difficult to obtain the fieldname.

Copy link
Member

Choose a reason for hiding this comment

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

Please put fieldname as UNKNOWN.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please put fieldname as UNKNOWN.

done.

builder.length(column.getColumnLength());
return builder.build();
case DECIMAL:
int precision =
Copy link
Member

Choose a reason for hiding this comment

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

In some cases, the precision and scale obtained here may be 0, and you must handle this situation to achieve better compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In some cases, the precision and scale obtained here may be 0, and you must handle this situation to achieve better compatibility.

done.


OPERATION_NOT_SUPPORTED("COMMON-26", "<identifier> <operation> is unsupported.");
OPERATION_NOT_SUPPORTED("COMMON-26", "<identifier> <operation> is unsupported."),
UNSUPPORTED_DATA_TYPE_SIMPLE("COMMON-27", "'<identifier>' unsupported data type '<dataType>'"),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
UNSUPPORTED_DATA_TYPE_SIMPLE("COMMON-27", "'<identifier>' unsupported data type '<dataType>'"),

@dailai
Copy link
Contributor

dailai commented May 22, 2024

@xiaochen-zhou Please resolve the conflicts.

@dailai
Copy link
Contributor

dailai commented May 22, 2024

@xiaochen-zhou Please resolve the conflicts.

image

# Conflicts:
#	seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java
#	seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java
@xiaochen-zhou
Copy link
Contributor Author

@xiaochen-zhou Please resolve the conflicts.

image

done.

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

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

LGTM if ci passed.

@xiaochen-zhou
Copy link
Contributor Author

LGTM if ci passed.

done.

@hailin0 hailin0 merged commit 6cf6e41 into apache:dev May 23, 2024
4 checks passed
@xiaochen-zhou xiaochen-zhou deleted the paimon_catalog_basetype branch May 23, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants