Class TableSchemaUtils

    • Constructor Detail

      • TableSchemaUtils

        public TableSchemaUtils()
    • Method Detail

      • getPersistedSchema

        public static TableSchema getPersistedSchema​(TableSchema tableSchema)
        Return TableSchema which consists of all persisted columns. That means, the virtual computed columns and metadata columns are filtered out.

        Its difference from getPhysicalSchema(TableSchema) is that it includes of all physical columns and metadata columns without virtual keyword.

      • containsPhysicalColumnsOnly

        public static boolean containsPhysicalColumnsOnly​(TableSchema schema)
        Returns true if there are only physical columns in the given TableSchema.
      • checkOnlyPhysicalColumns

        public static TableSchema checkOnlyPhysicalColumns​(TableSchema schema)
        Throws an exception if the given TableSchema contains any non-physical columns.
      • getPrimaryKeyIndices

        public static int[] getPrimaryKeyIndices​(TableSchema schema)
        Returns the field indices of primary key in the physical columns of this schema (not include computed columns or metadata columns).
      • builderWithGivenSchema

        public static TableSchema.Builder builderWithGivenSchema​(TableSchema oriSchema)
        Creates a builder with given table schema.
        Parameters:
        oriSchema - Original schema
        Returns:
        the builder with all the information from the given schema
      • dropConstraint

        public static TableSchema dropConstraint​(TableSchema oriSchema,
                                                 String constraintName)
        Creates a new schema but drop the constraint with given name.