Skip to content

Commit

Permalink
move SystemColumns from paimon core to common
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouxxyy committed Feb 27, 2024
1 parent 71e0184 commit 4d1ec9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.paimon.fs.FileIO;
import org.apache.paimon.fs.Path;
import org.apache.paimon.reader.RecordReader.RecordIterator;
import org.apache.paimon.schema.SystemColumns;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.IOUtils;
Expand Down Expand Up @@ -124,7 +125,7 @@ public OrcReaderBatch createReaderBatch(
for (int i = 0; i < vectors.length; i++) {
String name = tableFieldNames.get(i);
DataType type = tableFieldTypes.get(i);
if ("_ROW_POSITION".equals(name)) {
if (name.equals(SystemColumns.ROW_POSITION)) {
vectors[i] =
new OrcRowPositionColumnVector(
orcBatch.cols[tableFieldNames.indexOf(name)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.paimon.options.Options;
import org.apache.paimon.reader.RecordReader;
import org.apache.paimon.reader.RecordReader.RecordIterator;
import org.apache.paimon.schema.SystemColumns;
import org.apache.paimon.types.DataType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.Pool;
Expand Down Expand Up @@ -139,7 +140,7 @@ private MessageType clipParquetSchema(GroupType parquetSchema) {
Type[] types = new Type[projectedFields.length];
for (int i = 0; i < projectedFields.length; ++i) {
String fieldName = projectedFields[i];
if (fieldName.equals("_ROW_POSITION")) {
if (fieldName.equals(SystemColumns.ROW_POSITION)) {
types[i] =
ParquetSchemaConverter.convertToParquetType(fieldName, projectedTypes[i]);
} else if (!parquetSchema.containsField(fieldName)) {
Expand Down

0 comments on commit 4d1ec9b

Please sign in to comment.