Class DynamicTupleRecordType

  • All Implemented Interfaces:
    RelDataType, RelDataTypeFamily

    public class DynamicTupleRecordType
    extends DynamicRecordTypeImpl
    Represents Pig Tuples with unknown fields. The tuple field can only be accessed via name '$index', like ('$0', '$1'). The tuple is then resized to match the index.
    • Field Detail

      • INDEX_PATTERN

        private static final java.util.regex.Pattern INDEX_PATTERN
    • Constructor Detail

    • Method Detail

      • getField

        public RelDataTypeField getField​(java.lang.String fieldName,
                                         boolean caseSensitive,
                                         boolean elideRecord)
        Description copied from interface: RelDataType
        Looks up a field by name.

        NOTE: Be careful choosing the value of caseSensitive:

        • If the field name was supplied by an end-user (e.g. as a column alias in SQL), use your session's case-sensitivity setting.
        • Only hard-code true if you are sure that the field name is internally generated.
        • Hard-coding false is almost certainly wrong.
        Specified by:
        getField in interface RelDataType
        Overrides:
        getField in class DynamicRecordTypeImpl
        Parameters:
        fieldName - Name of field to find
        caseSensitive - Whether match is case-sensitive
        elideRecord - Whether to find fields nested within records
        Returns:
        named field, or null if not found
      • resize

        void resize​(int size)
        Resizes the record if the new size greater than the current size.
        Parameters:
        size - New size
      • nameToIndex

        private static int nameToIndex​(java.lang.String fieldName)
        Gets index number from field name.
        Parameters:
        fieldName - Field name, format example '$1'