Class FragmentSingle
java.lang.Object
io.trino.operator.table.json.execution.FragmentSingle
- All Implemented Interfaces:
JsonTableProcessingFragment
-
Constructor Summary
ConstructorsConstructorDescriptionFragmentSingle(IrJsonPath path, List<Column> columns, boolean errorOnError, boolean outer, JsonTableProcessingFragment child, Object[] newRow, ConnectorSession session, Metadata metadata, TypeManager typeManager, FunctionManager functionManager) -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns an array containing indexes of columns produced by the fragment within all columns produced by json_table.booleangetRow()All values produced by the columns are stored on corresponding positions in `newRow`.voidPrepares the Fragment to produce rows for the new JSON item.voidresetRoot(com.fasterxml.jackson.databind.JsonNode item, Page input, int position, Object[] pathParameters) FragmentSingle can be the root Fragment.
-
Constructor Details
-
FragmentSingle
public FragmentSingle(IrJsonPath path, List<Column> columns, boolean errorOnError, boolean outer, JsonTableProcessingFragment child, Object[] newRow, ConnectorSession session, Metadata metadata, TypeManager typeManager, FunctionManager functionManager)
-
-
Method Details
-
reset
Description copied from interface:JsonTableProcessingFragmentPrepares the Fragment to produce rows for the new JSON item. Note: This method must be called for each new JSON item. Due to nesting, there might be multiple JSON items to process for a single position in the input page. Therefore, input and position may not change for subsequent calls.- Specified by:
resetin interfaceJsonTableProcessingFragment- Parameters:
item- the new JSON iteminput- the input Page currently processed by json_table functionposition- the currently processed position in the input page
-
resetRoot
public void resetRoot(com.fasterxml.jackson.databind.JsonNode item, Page input, int position, Object[] pathParameters) FragmentSingle can be the root Fragment. The root fragment is the only fragment that may have path parameters. Prepares the root Fragment to produce rows for the new JSON item and a set of path parameters.- Specified by:
resetRootin interfaceJsonTableProcessingFragment- Parameters:
item- the new JSON iteminput- the input Page currently processed by json_table functionposition- the currently processed position in the input pagepathParameters- JSON path parameters for the top-level JSON path
-
getRow
public boolean getRow()All values produced by the columns are stored on corresponding positions in `newRow`. The values in `newRow` are not cleared between subsequent calls to `getRow()`, so the values for columns are automatically reused during iterating over child.- Specified by:
getRowin interfaceJsonTableProcessingFragment- Returns:
- true if row was produced, false if row was not produced (Fragment is finished)
-
getOutputLayout
public int[] getOutputLayout()Description copied from interface:JsonTableProcessingFragmentReturns an array containing indexes of columns produced by the fragment within all columns produced by json_table.- Specified by:
getOutputLayoutin interfaceJsonTableProcessingFragment
-