Interface PartitionedTable


  • @PublicEvolving
    public interface PartitionedTable
    A table that has been partitioned by a set of partition keys.

    Currently, partitioned table objects are intended for table arguments of process table functions (PTFs) that take table arguments with set semantics (ArgumentTrait.SET_SEMANTIC_TABLE).

    See Also:
    ProcessTableFunction
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ApiExpression asArgument​(String name)
      Converts this table object into a named argument.
      Table process​(Class<? extends org.apache.flink.table.functions.UserDefinedFunction> function, Object... arguments)
      Transforms the given table by passing it into a process table function (PTF) with set semantics.
      Table process​(String path, Object... arguments)
      Transforms the given table by passing it into a process table function (PTF) with set semantics.
    • Method Detail

      • asArgument

        ApiExpression asArgument​(String name)
        Converts this table object into a named argument.

        This method is intended for calls to process table functions (PTFs) that take table arguments.

        Example:

        
         env.fromCall(
           "MyPTF",
           table.partitionBy($("key")).asArgument("input_table")
         )
         
        Returns:
        an expression that can be passed into TableEnvironment.fromCall(java.lang.String, java.lang.Object...).
        See Also:
        ProcessTableFunction
      • process

        Table process​(String path,
                      Object... arguments)
        Transforms the given table by passing it into a process table function (PTF) with set semantics.

        A PTF maps zero, one, or multiple tables to a new table. PTFs are the most powerful function kind for Flink SQL and Table API. They enable implementing user-defined operators that can be as feature-rich as built-in operations. PTFs have access to Flink's managed state, event-time and timer services, and underlying table changelogs.

        This method assumes a call to a previously registered function that takes exactly one table argument with set semantics as the first argument. Additional scalar arguments can be passed if necessary. Thus, this method is a shortcut for:

        
         env.fromCall(
           "MyPTF",
           THIS_TABLE,
           SOME_SCALAR_ARGUMENTS...
         );
         

        Example:

        
         env.createFunction("MyPTF", MyPTF.class);
        
         Table table = table
           .partitionBy($("key"))
           .process(
             "MyPTF"
             lit("Bob").asArgument("default_name"),
             lit(42).asArgument("default_threshold")
           );
         
        Parameters:
        path - The path of a function
        arguments - Table and scalar argument Expressions.
        Returns:
        The Table object describing the pipeline for further transformations.
        See Also:
        Expressions.call(String, Object...), ProcessTableFunction
      • process

        Table process​(Class<? extends org.apache.flink.table.functions.UserDefinedFunction> function,
                      Object... arguments)
        Transforms the given table by passing it into a process table function (PTF) with set semantics.

        A PTF maps zero, one, or multiple tables to a new table. PTFs are the most powerful function kind for Flink SQL and Table API. They enable implementing user-defined operators that can be as feature-rich as built-in operations. PTFs have access to Flink's managed state, event-time and timer services, and underlying table changelogs.

        This method assumes a call to an unregistered, inline function that takes exactly one table argument with set semantics as the first argument. Additional scalar arguments can be passed if necessary. Thus, this method is a shortcut for:

        
         env.fromCall(
           MyPTF.class,
           THIS_TABLE,
           SOME_SCALAR_ARGUMENTS...
         );
         

        Example:

        
         Table table = table
           .partitionBy($("key"))
           .process(
             MyPTF.class,
             lit("Bob").asArgument("default_name"),
             lit(42).asArgument("default_threshold")
           );
         
        Parameters:
        function - The class containing the function's logic.
        arguments - Table and scalar argument Expressions.
        Returns:
        The Table object describing the pipeline for further transformations.
        See Also:
        Expressions.call(String, Object...), ProcessTableFunction