JingsongLi commented on code in PR #1264:
URL: https://github.com/apache/incubator-paimon/pull/1264#discussion_r1212496546
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java:
##########
@@ -575,7 +582,26 @@ public static Schema fromCatalogTable(CatalogTable
catalogTable) {
private static Map<String, String> getColumnComments(CatalogTable
catalogTable) {
return catalogTable.getUnresolvedSchema().getColumns().stream()
.filter(c -> c.getComment().isPresent())
- .collect(Collectors.toMap(UnresolvedColumn::getName, c ->
c.getComment().get()));
+ .collect(
+ Collectors.toMap(
+ UnresolvedColumn::getName,
+ c -> {
+ String comment = c.getComment().get();
+ if
(comment.toUpperCase().startsWith("U&'")) {
+ try {
+ SqlParser parser =
SqlParser.create(comment + "'");
Review Comment:
I am more worried about whether there is another way? The introduction of
the calcite dependency looks a bit heavy, is it possible to just simply deal
with it?
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java:
##########
@@ -575,7 +582,26 @@ public static Schema fromCatalogTable(CatalogTable
catalogTable) {
private static Map<String, String> getColumnComments(CatalogTable
catalogTable) {
return catalogTable.getUnresolvedSchema().getColumns().stream()
.filter(c -> c.getComment().isPresent())
- .collect(Collectors.toMap(UnresolvedColumn::getName, c ->
c.getComment().get()));
+ .collect(
+ Collectors.toMap(
+ UnresolvedColumn::getName,
+ c -> {
+ String comment = c.getComment().get();
+ if
(comment.toUpperCase().startsWith("U&'")) {
+ try {
+ SqlParser parser =
SqlParser.create(comment + "'");
Review Comment:
We need test to cover chinese comments, for Flink, for Hive
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]