Class IcebergUtils

java.lang.Object
org.gridgain.internal.sql.copy.iceberg.IcebergUtils

public final class IcebergUtils extends Object
Utility class for working with iceberg properties/types/schema/etc.
See Also:
  • Method Details

    • combineProperties

      public static Map<String,String> combineProperties(org.apache.ignite.internal.sql.engine.prepare.copy.CopyLocationPath location, Map<String,String> properties)
      Creates new instance of catalog properties and computes new entries if absent.
      Returns:
      New properties map.
    • combineConfiguration

      public static org.apache.hadoop.conf.Configuration combineConfiguration(Map<String,String> properties, LocationGuard guard)
      Creates new instance with of hadoop configuration with some properties if absent.

      The user-supplied S3 endpoint / credential mode is validated here too: the Iceberg / Hadoop-S3A path does not go through S3ClientFactory, so without this check a malicious s3.endpoint / fs.s3a.endpoint would re-open the SSRF + ambient-credential-exfiltration vector that the S3 client factory closes.

      Parameters:
      properties - Catalog properties.
      guard - Location guard enforcing the endpoint allow-list and the custom-endpoint-requires-explicit-keys rule.
      Returns:
      New hadoop configuration.
    • validateAllowedKeys

      public static void validateAllowedKeys(Map<String,String> properties)
      Rejects any COPY property key not on the Iceberg allow-list (see ALLOWED_EXACT_KEYS).
    • asList

      public static List<Object> asList(org.apache.iceberg.data.Record rec, List<String> columns)
      Iceberg record as list.
    • asRecord

      public static org.apache.iceberg.data.GenericRecord asRecord(List<?> row, org.apache.iceberg.data.GenericRecord rec, org.apache.iceberg.Schema schema)
      GridGain row as iceberg record.
    • asIcebergSchema

      public static org.apache.iceberg.Schema asIcebergSchema(List<org.apache.ignite.internal.schema.Column> ggColumns)
      GridGain columns metadata as iceberg schema.
    • asIcebergValue

      public static Object asIcebergValue(@Nullable @Nullable Object o)
      Converts object to iceberg type if needed.
    • asGridGainValue

      public static Object asGridGainValue(Object o)
      Converts object to gridgain type if needed.