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


        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
        getField in class DynamicRecordTypeImpl
        fieldName - Name of field to find
        caseSensitive - Whether match is case-sensitive
        elideRecord - Whether to find fields nested within records
        named field, or null if not found
      • resize

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

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