-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support rcbinary/rctext/sequence file for external file table in jni connector #41067
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
public static final String NAME = "local"; | ||
public static final String PROP_FILE_PATH = "file_path"; | ||
public static final String PROP_BACKEND_ID = "backend_id"; | ||
public static final String PROP_SHARED_STORAGE = "shared_storage"; | ||
|
||
private static final Logger LOG = LogManager.getLogger(LocalTableValuedFunction.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to move this code
@@ -144,6 +143,11 @@ public BrokerDesc getBrokerDesc() { | |||
return new BrokerDesc("LocalTvfBroker", StorageType.LOCAL, locationProperties); | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not move code that unrelated to your feature
@@ -258,6 +258,15 @@ public void analyze(Analyzer analyzer, List<Expr> resultExprs, List<String> colL | |||
headerType = FileFormatConstants.FORMAT_CSV_WITH_NAMES_AND_TYPES; | |||
fileFormatType = TFileFormatType.FORMAT_CSV_PLAIN; | |||
break; | |||
case "rcbinary": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you support write sequence/rcfile too?
protected Optional<String> resourceName = Optional.empty(); | ||
|
||
// User specified csv columns, it will override columns got from file | ||
private final List<Column> csvSchema = Lists.newArrayList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not move code
private String useMetastore; | ||
// Comma-separated list of column names. | ||
// Only applicable when useMetastore is false and for formats like RCFile and SequenceFile. | ||
private String columnNamesStr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reuse FileFormatUtils.parseCsvSchema()
?
Although it is called "csv schema", but actually it can be used for any file format which need specified schema
throw new AnalysisException("use metastore is disable, should set column names and column types."); | ||
} | ||
} | ||
// TODO: set metastore address in else branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to support use_hivemetastore
in tvf.
@@ -377,6 +410,22 @@ public List<Column> getTableColumns() throws AnalysisException { | |||
return columns; | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not remove code
Proposed changes
Issue Number: #30669
This change supports reading the contents of external file tables from rcbinary, rctext, and sequence files via the JNI connector.
todo-lists:
Example: