You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/26 02:38:24 UTC
[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #237: [FLINK-28677] Primary key should not be null when creating Spark table
JingsongLi commented on code in PR #237:
URL: https://github.com/apache/flink-table-store/pull/237#discussion_r929472578
##########
flink-table-store-spark/src/main/java/org/apache/flink/table/store/spark/SparkCatalog.java:
##########
@@ -291,8 +291,19 @@ private UpdateSchema toUpdateSchema(
: Arrays.stream(pkAsString.split(","))
.map(String::trim)
.collect(Collectors.toList());
+ RowType rowType = (RowType) toFlinkType(schema);
+ List<String> fields = rowType.getFieldNames();
+ if (!primaryKeys.isEmpty()) {
Review Comment:
We can add this check in UpdateSchema.
- Primary / partition keys should in fields.
- Pk not null. (Or convert pk fields to not null)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org