Class PythonTableUtils


  • @Internal
    public final class PythonTableUtils
    extends Object
    Python utilities.
    • Method Detail

      • createTableFromElement

        public static org.apache.flink.table.api.Table createTableFromElement​(org.apache.flink.table.api.TableEnvironment tEnv,
                                                                              String filePath,
                                                                              org.apache.flink.table.types.DataType schema,
                                                                              boolean batched)
        Create a table from PythonDynamicTableSource that read data from input file with specific DataType.
        Parameters:
        tEnv - The TableEnvironment to create table.
        filePath - the file path of the input data.
        schema - The python data type.
        batched - Whether to read data in a batch
        Returns:
        Table with InputFormat.
      • getInputFormat

        public static org.apache.flink.api.common.io.InputFormat<org.apache.flink.table.data.RowData,​?> getInputFormat​(List<Object[]> data,
                                                                                                                             org.apache.flink.table.types.DataType dataType)
        Wrap the unpickled python data with an InputFormat. It will be passed to PythonDynamicTableSource later.
        Parameters:
        data - The unpickled python data.
        dataType - The python data type.
        Returns:
        An InputFormat containing the python data.