Skip to content

Commit

Permalink
Merge pull request #1 from syucream/flink-pb-format-java11
Browse files Browse the repository at this point in the history
Use BinaryStringData directly to keep java8 compatibility
  • Loading branch information
maosuhan authored Jan 7, 2021
2 parents 6b2d6e0 + 64dc032 commit a9a50e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public String codegen(String returnVarName, String messageGetStr) {
case STRING:
case ENUM:
sb.append(
returnVarName + " = StringData.fromString(" + messageGetStr + ".toString());");
returnVarName + " = BinaryStringData.fromString(" + messageGetStr
+ ".toString());");
break;
}
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.flink.table.data.GenericRowData;
import org.apache.flink.table.data.RowData;
import org.apache.flink.table.data.StringData;
import org.apache.flink.table.data.binary.BinaryStringData;
import org.apache.flink.table.types.logical.RowType;

import com.google.protobuf.Descriptors;
Expand Down Expand Up @@ -63,7 +64,7 @@ public ProtoToRowConverter(
se.setDefaultImports(
RowData.class.getName(),
ArrayData.class.getName(),
StringData.class.getName(),
BinaryStringData.class.getName(),
GenericRowData.class.getName(),
GenericMapData.class.getName(),
GenericArrayData.class.getName(),
Expand Down

0 comments on commit a9a50e7

Please sign in to comment.