Skip to content

Commit

Permalink
[Enhancement][Cherry-Pick][Branch-3.1] Add unkown file format in scan…
Browse files Browse the repository at this point in the history
… range (StarRocks#33147)

Signed-off-by: Smith Cruise <[email protected]>
(cherry picked from commit 39c9e43)
  • Loading branch information
Smith-Cruise authored and wanpengfei-git committed Oct 19, 2023
1 parent 77821ab commit 2644838
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public THdfsFileFormat toThrift() {
case TEXT:
return THdfsFileFormat.TEXT;
default:
break;
return THdfsFileFormat.UNKNOWN;
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.starrocks.connector.hive;

import com.starrocks.connector.hive.RemoteFileInputFormat;
import com.starrocks.thrift.THdfsFileFormat;
import org.junit.Assert;
import org.junit.Test;

Expand All @@ -27,4 +28,10 @@ public void testParquetFormat() {
Assert.assertSame(RemoteFileInputFormat.ORC,
RemoteFileInputFormat.fromHdfsInputFormatClass("org.apache.hadoop.hive.ql.io.orc.OrcInputFormat"));
}

@Test
public void testUnknownFormat() {
RemoteFileInputFormat format = RemoteFileInputFormat.UNKNOWN;
Assert.assertEquals(THdfsFileFormat.UNKNOWN, format.toThrift());
}
}
16 changes: 9 additions & 7 deletions gensrc/thrift/Descriptors.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ struct TTupleDescriptor {
}

enum THdfsFileFormat {
TEXT,
LZO_TEXT,
RC_FILE,
SEQUENCE_FILE,
AVRO,
PARQUET,
ORC,
TEXT = 0,
LZO_TEXT = 1,
RC_FILE = 2,
SEQUENCE_FILE = 3,
AVRO = 4,
PARQUET = 5,
ORC = 6,

UNKNOWN = 100
}


Expand Down

0 comments on commit 2644838

Please sign in to comment.