コード例 #1
0
 @Test
 public void testAlterPartitionedTablePartitionColumnPolicy() throws Exception {
   expectedException.expect(IllegalArgumentException.class);
   expectedException.expectMessage(
       "Invalid property \"column_policy\" passed to [ALTER | CREATE] TABLE statement");
   analyze("alter table parted partition (date=1395874800000) set (column_policy='strict')");
 }
コード例 #2
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByInnerObject() throws Exception {
   analyze(
       "create table my_table ("
           + "  a object as(b object as(name string)),"
           + "  date timestamp"
           + ") partitioned by (a['b'])");
 }
コード例 #3
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByArray() throws Exception {
   analyze(
       "create table my_table ("
           + "  a array(string),"
           + "  date timestamp"
           + ") partitioned by (a)");
 }
コード例 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByClusteredBy() throws Exception {
   analyze(
       "create table my_table ("
           + "  id integer,"
           + "  name string"
           + ") partitioned by (id)"
           + "  clustered by (id) into 5 shards");
 }
コード例 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByNotPartOfPrimaryKey() throws Exception {
   analyze(
       "create table my_table ("
           + "  id1 integer,"
           + "  id2 integer,"
           + "  date timestamp,"
           + "  primary key (id1, id2)"
           + ") partitioned by (id1, date)");
 }
コード例 #6
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByArrayNestedColumns() throws Exception {
   analyze(
       "create table my_table ("
           + "  a array(object as ("
           + "    name string"
           + "  )),"
           + "  date timestamp"
           + ") partitioned by (date, a['name'])");
 }
コード例 #7
0
 @Test(expected = IllegalArgumentException.class)
 public void testPartitionedByCompoundIndex() throws Exception {
   analyze(
       "create table my_table("
           + "  name string index using fulltext,"
           + "  no_index string index off,"
           + "  stuff string,"
           + "  o object as (s string),"
           + "  index ft using fulltext(stuff, o['s']) with (analyzer='snowball')"
           + ") partitioned by (ft)");
 }
コード例 #8
0
 @Test
 public void testAlterPartitionedTableOnlyWithPartition() throws Exception {
   expectedException.expect(ParsingException.class);
   analyze("alter table ONLY parted partition (date=1395874800000) set (column_policy='strict')");
 }
コード例 #9
0
 @Test(expected = IllegalArgumentException.class)
 public void testAlterTableWithPartitionClause() throws Exception {
   analyze("alter table users partition (date='1970-01-01') reset (number_of_replicas)");
 }
コード例 #10
0
 @Test(expected = IllegalArgumentException.class)
 public void testAlterPartitionedTableInvalidNumber() throws Exception {
   analyze(
       "alter table multi_parted partition (date=1395874800000) set (number_of_replicas='0-all')");
 }
コード例 #11
0
 @Test(expected = IllegalArgumentException.class)
 public void testAlterPartitionedTableInvalidPartitionColumns() throws Exception {
   analyze("alter table parted partition (a=1) set (number_of_replicas='0-all')");
 }
コード例 #12
0
 @Test(expected = IllegalArgumentException.class)
 public void testAlterPartitionedTableNonExistentPartition() throws Exception {
   analyze("alter table parted partition (date='1970-01-01') set (number_of_replicas='0-all')");
 }
コード例 #13
0
 @Test
 public void testPartitionByUnknownColumn() throws Exception {
   expectedException.expect(ColumnUnknownException.class);
   analyze("create table my_table (p string) partitioned by (a)");
 }