Class TableDescriptor.Builder

    • Constructor Detail

      • Builder

        protected Builder()
    • Method Detail

      • option

        public TableDescriptor.Builder option​(String key,
                                              String value)
        Sets the given option on the table.

        Option keys must be fully specified. When defining options for a format, use format(FormatDescriptor) instead.

        Example:

        
         TableDescriptor.forConnector("kafka")
           .option("scan.startup.mode", "latest-offset")
           .build();
         
      • format

        public TableDescriptor.Builder format​(FormatDescriptor formatDescriptor)
        Defines the format to be used for this table.

        Note that not every connector requires a format to be specified, while others may use multiple formats.

        Options of the provided {@param formatDescriptor} are automatically prefixed. For example,

        
         descriptorBuilder.format(FormatDescriptor.forFormat("json")
           .option(JsonOptions.IGNORE_PARSE_ERRORS, true)
           .build()
         

        will result in the options

        
         'format' = 'json'
         'json.ignore-parse-errors' = 'true'
         
      • format

        public TableDescriptor.Builder format​(ConfigOption<String> formatOption,
                                              FormatDescriptor formatDescriptor)
        Defines the format to be used for this table.

        Note that not every connector requires a format to be specified, while others may use multiple formats.

        Options of the provided {@param formatDescriptor} are automatically prefixed. For example,

        
         descriptorBuilder.format(KafkaOptions.KEY_FORMAT, FormatDescriptor.forFormat("json")
           .option(JsonOptions.IGNORE_PARSE_ERRORS, true)
           .build()
         

        will result in the options

        
         'key.format' = 'json'
         'key.json.ignore-parse-errors' = 'true'
         
      • distributedByHash

        public TableDescriptor.Builder distributedByHash​(String... bucketKeys)
        Defines that the table should be distributed into buckets using a hash algorithm over the given columns. The number of buckets is connector-defined.
      • distributedByHash

        public TableDescriptor.Builder distributedByHash​(int numberOfBuckets,
                                                         String... bucketKeys)
        Defines that the table should be distributed into the given number of buckets using a hash algorithm over the given columns.
      • distributedByRange

        public TableDescriptor.Builder distributedByRange​(String... bucketKeys)
        Defines that the table should be distributed into buckets using a range algorithm over the given columns. The number of buckets is connector-defined.
      • distributedByRange

        public TableDescriptor.Builder distributedByRange​(int numberOfBuckets,
                                                          String... bucketKeys)
        Defines that the table should be distributed into the given number of buckets using a range algorithm over the given columns.
      • distributedBy

        public TableDescriptor.Builder distributedBy​(String... bucketKeys)
        Defines that the table should be distributed into buckets over the given columns. The number of buckets and used algorithm are connector-defined.
      • distributedBy

        public TableDescriptor.Builder distributedBy​(int numberOfBuckets,
                                                     String... bucketKeys)
        Defines that the table should be distributed into the given number of buckets by the given columns. The used algorithm is connector-defined.
      • distributedInto

        public TableDescriptor.Builder distributedInto​(int numberOfBuckets)
        Defines that the table should be distributed into the given number of buckets. The algorithm is connector-defined.