public class OrcTableSource extends Object implements org.apache.flink.table.sources.BatchTableSource<Row>, org.apache.flink.table.sources.ProjectableTableSource<Row>, org.apache.flink.table.sources.FilterableTableSource<Row>
The OrcTableSource
supports projection and filter push-down.
An OrcTableSource
is used as shown in the example below.
OrcTableSource orcSrc = OrcTableSource.builder()
.path("file:///my/data/file.orc")
.forOrcSchema("struct<col1:boolean,col2:tinyint,col3:smallint,col4:int>")
.build();
tEnv.registerTableSource("orcTable", orcSrc);
Table res = tableEnv.sql("SELECT * FROM orcTable");
Modifier and Type | Class and Description |
---|---|
static class |
OrcTableSource.Builder
Constructs an
OrcTableSource . |
Modifier and Type | Method and Description |
---|---|
org.apache.flink.table.sources.TableSource<Row> |
applyPredicate(List<org.apache.flink.table.expressions.Expression> predicates) |
static OrcTableSource.Builder |
builder() |
protected OrcRowInputFormat |
buildOrcInputFormat() |
String |
explainSource() |
DataSet<Row> |
getDataSet(ExecutionEnvironment execEnv) |
TypeInformation<Row> |
getReturnType() |
org.apache.flink.table.api.TableSchema |
getTableSchema() |
boolean |
isFilterPushedDown() |
org.apache.flink.table.sources.TableSource<Row> |
projectFields(int[] selectedFields) |
public DataSet<Row> getDataSet(ExecutionEnvironment execEnv)
getDataSet
in interface org.apache.flink.table.sources.BatchTableSource<Row>
@VisibleForTesting protected OrcRowInputFormat buildOrcInputFormat()
public TypeInformation<Row> getReturnType()
getReturnType
in interface org.apache.flink.table.sources.TableSource<Row>
public org.apache.flink.table.api.TableSchema getTableSchema()
getTableSchema
in interface org.apache.flink.table.sources.TableSource<Row>
public org.apache.flink.table.sources.TableSource<Row> projectFields(int[] selectedFields)
projectFields
in interface org.apache.flink.table.sources.ProjectableTableSource<Row>
public org.apache.flink.table.sources.TableSource<Row> applyPredicate(List<org.apache.flink.table.expressions.Expression> predicates)
applyPredicate
in interface org.apache.flink.table.sources.FilterableTableSource<Row>
public boolean isFilterPushedDown()
isFilterPushedDown
in interface org.apache.flink.table.sources.FilterableTableSource<Row>
public String explainSource()
explainSource
in interface org.apache.flink.table.sources.TableSource<Row>
public static OrcTableSource.Builder builder()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.