-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug] [Maxcompute] Failed to parse some maxcompute type #3894
Conversation
@TaoZex |
|
||
SimpleArrayTypeInfo(TypeInfo typeInfo) { | ||
if (typeInfo == null) { | ||
throw new IllegalArgumentException("Invalid element type."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new MaxcomputeConnectorException(CommonErrorCode.UNSUPPORTED_DATA_TYPE)
this.keyType = keyType; | ||
this.valueType = valueType; | ||
} else { | ||
throw new IllegalArgumentException("Invalid key or value type for map."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
private void validateParameters(List<String> names, List<TypeInfo> typeInfos) { | ||
if (names != null && typeInfos != null && !names.isEmpty() && !typeInfos.isEmpty()) { | ||
if (names.size() != typeInfos.size()) { | ||
throw new IllegalArgumentException("The amount of field names must be equal to the amount of field types."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
throw new IllegalArgumentException("The amount of field names must be equal to the amount of field types."); | ||
} | ||
} else { | ||
throw new IllegalArgumentException("Invalid name or element type for struct."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@TyrantLucifer |
Can you help to add MaxCompute E2E, if so will be very helpful. |
@Hisoka-X |
Got it. |
It would be even better if you can provide the corresponding test code, you can set it to disable, that is, it will not be executed by default, but other developers, they can perform simple configurations according to their own environment to execute IT |
OK, I will supplement. |
@Hisoka-X @CalvinKirs |
I tested the code using a tableSchema like "id BIGINT, shopname STRING, start_date DATE, price DOUBLE, create_time DATETIME, update_timestamp TIMESTAMP, f1 tinyint, f2 smallint, f3 int, f4 float, f5 decimal(38,18), f6 char(20), f7 varchar(30), f8 boolean" and sink to mysql , mostly get the right result. |
fd4dc68
to
6e9d3c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM,but you should offer the test snapshot images to verify this pull request is valid. Thank you for your contribution of SeaTunnel.
# Conflicts: # seatunnel-connectors-v2/connector-maxcompute/src/main/java/com/aliyun/odps/type/SimpleArrayTypeInfo.java # seatunnel-connectors-v2/connector-maxcompute/src/main/java/com/aliyun/odps/type/SimpleMapTypeInfo.java # seatunnel-connectors-v2/connector-maxcompute/src/main/java/com/aliyun/odps/type/SimpleStructTypeInfo.java # seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java # seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeTypeMapper.java # seatunnel-connectors-v2/connector-maxcompute/src/test/java/BasicTypeToOdpsTypeTest.java # seatunnel-e2e/seatunnel-connector-v2-e2e/connector-maxcompute-e2e/pom.xml # seatunnel-e2e/seatunnel-connector-v2-e2e/connector-maxcompute-e2e/src/test/java/org/apache/seatunnel/e2e/connector/maxcompute/MaxcomputeIT.java # seatunnel-e2e/seatunnel-connector-v2-e2e/pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update
https://github.com/apache/incubator-seatunnel/blob/dev/release-note.md
https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/connector-v2/source/Maxcompute.md
https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/connector-v2/sink/Maxcompute.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please help me to see if there is something wrong with my configuration file, the configuration file is as follows:
My execution command is as follows:
But the task error log is as follows:
|
Purpose of this pull request
close #3893
I have tested most data types. eg
Check list
New License Guide
release-note
.