Search in sources :

Example 1 with ContinuousFileSource

use of org.apache.hudi.utils.source.ContinuousFileSource in project hudi by apache.

the class ContinuousFileSourceFactory method createDynamicTableSource.

@Override
public DynamicTableSource createDynamicTableSource(Context context) {
    FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context);
    helper.validate();
    Configuration conf = (Configuration) helper.getOptions();
    Path path = new Path(conf.getOptional(FlinkOptions.PATH).orElseThrow(() -> new ValidationException("Option [path] should be not empty.")));
    return new ContinuousFileSource(context.getCatalogTable().getResolvedSchema(), path, conf);
}
Also used : Path(org.apache.flink.core.fs.Path) ValidationException(org.apache.flink.table.api.ValidationException) Configuration(org.apache.flink.configuration.Configuration) FactoryUtil(org.apache.flink.table.factories.FactoryUtil) ContinuousFileSource(org.apache.hudi.utils.source.ContinuousFileSource)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)1 Path (org.apache.flink.core.fs.Path)1 ValidationException (org.apache.flink.table.api.ValidationException)1 FactoryUtil (org.apache.flink.table.factories.FactoryUtil)1 ContinuousFileSource (org.apache.hudi.utils.source.ContinuousFileSource)1