collabH opened a new pull request #103:
URL: https://github.com/apache/bahir-flink/pull/103


   # 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.
   
   ```java
   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')");
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to