Uploaded image for project: 'Bahir (Retired)'
  1. Bahir (Retired)
  2. BAHIR-255

Kudu flink-sql add hash partitions nums config&onwer config

    XMLWordPrintableJSON

Details

    • Patch
    • Thank you for your review

    Description

      Hash Partition Feature

      • The default number of buckets in the previous hash partition was 2* replicas, and there were some problems in the production environment, so I felt I should provide the displayed hash partition configuration.
      • Add the hash partition number configuration 'kudu.hash-partition-nums',which defaults to 3 if not specified.

      Singleton Test

       

      public class NewTablePropertiesTest extends KuduCatalogTest{
          private KuduCatalog catalog;
          private StreamTableEnvironment tableEnv;
      
          @BeforeEach
          public void init() {
              StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
              catalog = new KuduCatalog(harness.getMasterAddressesAsString());
              tableEnv = KuduTableTestUtils.createTableEnvWithBlinkPlannerStreamingMode(env);
              tableEnv.registerCatalog("kudu", catalog);
              tableEnv.useCatalog("kudu");
          }
      
          @Test
          public void testHashPartitionNums() throws TableNotExistException {
              catalog.dropTable(ObjectPath.fromString(EnvironmentSettings.DEFAULT_BUILTIN_DATABASE + ".TestTable1"), true);
              catalog.dropTable(ObjectPath.fromString(EnvironmentSettings.DEFAULT_BUILTIN_DATABASE + ".TestTable2"), true);
              tableEnv.executeSql("CREATE TABLE TestTable1 (`first` STRING, `second` String) WITH ('kudu.hash-columns' = 'first', 'kudu.primary-key-columns' = 'first')");
              tableEnv.executeSql("CREATE TABLE TestTable2 (`first` STRING, `second` String) WITH ('kudu.hash-columns' = 'first','kudu.hash-partition-nums'='6', 'kudu.primary-key-columns' = 'first')");
          }
      
      
          @Test
          public void testOwner() throws TableNotExistException {
              catalog.dropTable(ObjectPath.fromString(EnvironmentSettings.DEFAULT_BUILTIN_DATABASE + ".TestTable1"), true);
              tableEnv.executeSql("CREATE TABLE TestTable1 (`first` STRING, `second` String) WITH ('kudu.hash-columns' = 'first', 'kudu.primary-key-columns' = 'first','kudu.table-owner'='admin')");
          }
      }
      

      Other Ideas

      • Regarding the range partition, I think a JSON List can be passed in to describe the corresponding range partition, and I think the hash partition and range partition must exist in one

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Research ShiminHuang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified