drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] kkhatua closed pull request #1454: DRILL-6684: Swap sys.options and sys.options_val tables
Date Wed, 05 Sep 2018 00:00:07 GMT
kkhatua closed pull request #1454: DRILL-6684: Swap sys.options and sys.options_val tables
URL: https://github.com/apache/drill/pull/1454
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/SystemTable.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/SystemTable.java
index 8bdfb7f5162..62e610d73fc 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/SystemTable.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/SystemTable.java
@@ -31,28 +31,30 @@
  * </p>
  */
 public enum SystemTable {
-  OPTION("options", false, OptionValueWrapper.class) {
+  OPTIONS_OLD("options_old", false, OptionValueWrapper.class) {
+    @Deprecated
     @Override
     public Iterator<Object> getIterator(final ExecutorFragmentContext context, final
int maxRecords) {
       return new OptionIterator(context, OptionIterator.Mode.SYS_SESS_PUBLIC);
     }
   },
 
-  OPTION_VAL("options_val", false, ExtendedOptionIterator.ExtendedOptionValueWrapper.class)
{
+  OPTIONS("options", false, ExtendedOptionIterator.ExtendedOptionValueWrapper.class) {
     @Override
     public Iterator<Object> getIterator(final ExecutorFragmentContext context, final
int maxRecords) {
       return new ExtendedOptionIterator(context, false);
     }
   },
 
-  INTERNAL_OPTIONS("internal_options", false, OptionValueWrapper.class) {
+  INTERNAL_OPTIONS_OLD("internal_options_old", false, OptionValueWrapper.class) {
+    @Deprecated
     @Override
     public Iterator<Object> getIterator(final ExecutorFragmentContext context, final
int maxRecords) {
       return new OptionIterator(context, OptionIterator.Mode.SYS_SESS_INTERNAL);
     }
   },
 
-  INTERNAL_OPTIONS_VAL("internal_options_val", false, ExtendedOptionIterator.ExtendedOptionValueWrapper.class)
{
+  INTERNAL_OPTIONS("internal_options", false, ExtendedOptionIterator.ExtendedOptionValueWrapper.class)
{
     @Override
     public Iterator<Object> getIterator(final ExecutorFragmentContext context, final
int maxRecords) {
       return new ExtendedOptionIterator(context, true);
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
index 9d546694560..d9564b7d606 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
@@ -89,7 +89,7 @@ public void testCountOnNullableColumn() throws Exception {
   @Test
   public void testCountDistinctOnBoolColumn() throws Exception {
     testBuilder()
-        .sqlQuery("select count(distinct `bool_val`) as cnt from `sys`.`options`")
+        .sqlQuery("select count(distinct `bool_val`) as cnt from `sys`.`options_old`")
         .ordered()
         .baselineColumns("cnt")
         .baselineValues(2L)
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptions.java
index 32a913a531a..2c46db0ec3c 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptions.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptions.java
@@ -82,10 +82,10 @@ public void setAndResetSessionOption() throws Exception {
     // check changed
     test("SELECT status, accessibleScopes, name FROM sys.options WHERE optionScope = 'SESSION';");
     testBuilder()
-      .sqlQuery("SELECT num_val FROM sys.options WHERE name = '%s' AND optionScope = 'SESSION'",
SLICE_TARGET)
+      .sqlQuery("SELECT val FROM sys.options WHERE name = '%s' AND optionScope = 'SESSION'",
SLICE_TARGET)
       .unOrdered()
-      .baselineColumns("num_val")
-      .baselineValues((long) 10)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(10L))
       .build()
       .run();
 
@@ -115,10 +115,10 @@ public void setAndResetSystemOption() throws Exception {
     test("ALTER system SET `%s` = %b;", ENABLE_VERBOSE_ERRORS_KEY, true);
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE name = '%s' AND optionScope = 'SYSTEM'",
ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT val FROM sys.options WHERE name = '%s' AND optionScope = 'SYSTEM'",
ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
-      .baselineColumns("bool_val")
-      .baselineValues(true)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
       .build()
       .run();
 
@@ -140,10 +140,10 @@ public void resetAllSessionOptions() throws Exception {
     test("SET `%s` = %b;", ENABLE_VERBOSE_ERRORS_KEY, true);
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SESSION' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
-      .baselineColumns("bool_val")
-      .baselineValues(true)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
       .build()
       .run();
 
@@ -165,7 +165,7 @@ public void changeSessionAndSystemButRevertSession() throws Exception
{
     test("ALTER SYSTEM SET `%s` = %b;", ENABLE_VERBOSE_ERRORS_KEY, true);
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
@@ -173,12 +173,21 @@ public void changeSessionAndSystemButRevertSession() throws Exception
{
       .run();
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SYSTEM' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SYSTEM' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
       .build()
       .run();
+    // check changed new table
+    testBuilder()
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SESSION' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
+      .unOrdered()
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
+      .build()
+      .run();
+
 
     // reset session option
     test("RESET `%s`;", ENABLE_VERBOSE_ERRORS_KEY);
@@ -191,10 +200,10 @@ public void changeSessionAndSystemButRevertSession() throws Exception
{
       .run();
     // check unchanged
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SYSTEM' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SYSTEM' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
-      .baselineColumns("bool_val")
-      .baselineValues(true)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
       .build()
       .run();
     // reset system option
@@ -208,7 +217,7 @@ public void changeSessionAndNotSystem() throws Exception {
     test("ALTER SYSTEM SET `%s` = %b;", ENABLE_VERBOSE_ERRORS_KEY, true);
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
@@ -216,12 +225,20 @@ public void changeSessionAndNotSystem() throws Exception {
       .run();
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SYSTEM' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SYSTEM' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
       .build()
       .run();
+    // check changed for new table
+    testBuilder()
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SESSION' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
+      .unOrdered()
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
+      .build()
+      .run();
 
     // reset all session options
     test("ALTER SESSION RESET ALL;");
@@ -234,10 +251,10 @@ public void changeSessionAndNotSystem() throws Exception {
       .run();
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SYSTEM' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SYSTEM' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
-      .baselineColumns("bool_val")
-      .baselineValues(true)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
       .build()
       .run();
   }
@@ -249,7 +266,7 @@ public void changeSystemAndNotSession() throws Exception {
     test("ALTER SYSTEM SET `%s` = %b;", ENABLE_VERBOSE_ERRORS_KEY, true);
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
@@ -257,18 +274,26 @@ public void changeSystemAndNotSession() throws Exception {
       .run();
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SYSTEM' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT bool_val FROM sys.options_old WHERE optionScope = 'SYSTEM' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("bool_val")
       .baselineValues(true)
       .build()
       .run();
+    // check changed in new table
+    testBuilder()
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SESSION' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
+      .unOrdered()
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
+      .build()
+      .run();
 
     // reset option
     test("ALTER system RESET `%s`;", ENABLE_VERBOSE_ERRORS_KEY);
     // check reverted
     testBuilder()
-      .sqlQuery("SELECT status FROM sys.options WHERE name = '%s' AND optionScope = 'BOOT'",
ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT status FROM sys.options_old WHERE optionScope = 'BOOT' AND name =
'%s'", ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
       .baselineColumns("status")
       .baselineValues("DEFAULT")
@@ -276,10 +301,10 @@ public void changeSystemAndNotSession() throws Exception {
       .run();
     // check changed
     testBuilder()
-      .sqlQuery("SELECT bool_val FROM sys.options WHERE optionScope = 'SESSION' AND name
= '%s'", ENABLE_VERBOSE_ERRORS_KEY)
+      .sqlQuery("SELECT val FROM sys.options WHERE optionScope = 'SESSION' AND name = '%s'",
ENABLE_VERBOSE_ERRORS_KEY)
       .unOrdered()
-      .baselineColumns("bool_val")
-      .baselineValues(true)
+      .baselineColumns("val")
+      .baselineValues(String.valueOf(true))
       .build()
       .run();
   }
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptionsAuthEnabled.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptionsAuthEnabled.java
index 256735dff0d..a1a34c9c7fa 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptionsAuthEnabled.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/TestOptionsAuthEnabled.java
@@ -113,11 +113,11 @@ private void setOptHelper() throws Exception {
     try {
       test(setSysOptionQuery);
       testBuilder()
-          .sqlQuery(String.format("SELECT num_val FROM sys.options WHERE name = '%s' AND
optionScope = 'SYSTEM'",
+          .sqlQuery(String.format("SELECT val FROM sys.options WHERE name = '%s' AND optionScope
= 'SYSTEM'",
               ExecConstants.SLICE_TARGET))
           .unOrdered()
-          .baselineColumns("num_val")
-          .baselineValues(200L)
+          .baselineColumns("val")
+          .baselineValues(String.valueOf(200L))
           .go();
     } finally {
       test(String.format("ALTER SYSTEM SET `%s` = %d;", ExecConstants.SLICE_TARGET, ExecConstants.SLICE_TARGET_DEFAULT));
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/options/TestConfigLinkage.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/server/options/TestConfigLinkage.java
index 8fec57680bf..9ecf73e9ec2 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/options/TestConfigLinkage.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/options/TestConfigLinkage.java
@@ -62,9 +62,9 @@ public void testDefaultInternalValue() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String mockProp = client.queryBuilder().
-        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY).singletonString();
+        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(),
MOCK_PROPERTY).singletonString();
       String mockProp2 = client.queryBuilder().
-        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(),
MOCK_PROPERTY).singletonString();
+        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY).singletonString();
 
       assertEquals("a", mockProp);
       assertEquals("a", mockProp2);
@@ -82,9 +82,9 @@ public void testDefaultValidatorInternalValue() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String mockProp = client.queryBuilder().
-        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY).singletonString();
+        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(),
MOCK_PROPERTY).singletonString();
       String mockProp2 = client.queryBuilder().
-        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(),
MOCK_PROPERTY).singletonString();
+        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY).singletonString();
 
       assertEquals("a", mockProp);
       assertEquals("a", mockProp2);
@@ -98,7 +98,7 @@ public void testSessionOption() throws Exception {
       .sessionOption(ExecConstants.SLICE_TARGET, 10);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SESSION'", SystemTable.OPTION_VAL
+      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SESSION'", SystemTable.OPTIONS
         .getTableName())
         .singletonString();
       assertEquals(slice_target, "10");
@@ -112,7 +112,7 @@ public void testSystemOption() throws Exception {
       .systemOption(ExecConstants.SLICE_TARGET, 10000);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SYSTEM'", SystemTable.OPTION_VAL.getTableName())
+      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SYSTEM'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals(slice_target, "10000");
     }
@@ -130,10 +130,10 @@ public void testInternalSystemOption() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String mockProp = client.queryBuilder().
-        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY)
+        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(),
MOCK_PROPERTY)
         .singletonString();
       String mockProp2 = client.queryBuilder().
-        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(),
MOCK_PROPERTY)
+        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS.getTableName(),
MOCK_PROPERTY)
         .singletonString();
 
       assertEquals("blah", mockProp);
@@ -148,7 +148,7 @@ public void testConfigOption() throws Exception {
             .setOptionDefault(ExecConstants.SLICE_TARGET, 1000);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'BOOT'", SystemTable.OPTION_VAL.getTableName())
+      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'BOOT'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals(slice_target, "1000");
     }
@@ -160,7 +160,7 @@ public void testAlterSystem() throws Exception {
     try (ClusterFixture cluster = ClusterFixture.standardCluster(dirTestWatcher);
          ClientFixture client = cluster.clientFixture()) {
       client.queryBuilder().sql("ALTER SYSTEM SET `planner.slice_target` = 10000").run();
-      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SYSTEM'", SystemTable.OPTION_VAL.getTableName())
+      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SYSTEM'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals(slice_target, "10000");
     }
@@ -174,7 +174,7 @@ public void testSessionPrecedence() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       client.queryBuilder().sql("ALTER SESSION SET `planner.slice_target` = 10000").run();
-      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SESSION'", SystemTable.OPTION_VAL.getTableName())
+      String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target'
and optionScope = 'SESSION'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals(slice_target, "10000");
     }
@@ -187,7 +187,7 @@ public void testMaxWidthPerNodeConfig() throws Exception {
       .setOptionDefault(ExecConstants.MAX_WIDTH_PER_NODE_KEY, 2);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'BOOT'", SystemTable.OPTION_VAL.getTableName())
+      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'BOOT'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals("2", maxWidth);
     }
@@ -200,7 +200,7 @@ public void testMaxWidthPerNodeSystem() throws Exception {
       .systemOption(ExecConstants.MAX_WIDTH_PER_NODE_KEY, 3);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'SYSTEM'", SystemTable.OPTION_VAL.getTableName())
+      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'SYSTEM'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals("3", maxWidth);
     }
@@ -213,7 +213,7 @@ public void testMaxWidthPerNodeSession() throws Exception {
       .sessionOption(ExecConstants.MAX_WIDTH_PER_NODE_KEY, 2);
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
-      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'SESSION'", SystemTable.OPTION_VAL.getTableName())
+      String maxWidth = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.width.max_per_node'
and optionScope = 'SESSION'", SystemTable.OPTIONS.getTableName())
         .singletonString();
       assertEquals("2", maxWidth);
     }
@@ -243,7 +243,7 @@ public void testScope() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String scope = client.queryBuilder()
-                          .sql("SELECT optionScope from sys.%s where name='planner.slice_target'",
SystemTable.OPTION_VAL.getTableName())
+                          .sql("SELECT optionScope from sys.%s where name='planner.slice_target'",
SystemTable.OPTIONS.getTableName())
                           .singletonString();
       Assert.assertEquals("BOOT",scope);
     }
@@ -257,7 +257,7 @@ public void testScopeSystem() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String scope = client.queryBuilder()
-              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTION_VAL.getTableName())
+              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName())
               .singletonString();
       Assert.assertEquals("SYSTEM",scope);
     }
@@ -271,7 +271,7 @@ public void testScopeSession() throws Exception {
     try (ClusterFixture cluster = builder.build();
          ClientFixture client = cluster.clientFixture()) {
       String scope = client.queryBuilder()
-              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTION_VAL.getTableName())
+              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName())
               .singletonString();
       Assert.assertEquals("SESSION",scope);
     }
@@ -285,7 +285,7 @@ public void testScopeAlterSystem() throws Exception {
          ClientFixture client = cluster.clientFixture()) {
       client.queryBuilder().sql("ALTER SYSTEM set `planner.slice_target`= 10000").run();
       String scope = client.queryBuilder()
-              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTION_VAL.getTableName())
+              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName())
               .singletonString();
       Assert.assertEquals("SYSTEM",scope);
     }
@@ -299,7 +299,7 @@ public void testScopeAlterSession() throws Exception {
          ClientFixture client = cluster.clientFixture()) {
       client.queryBuilder().sql("ALTER SESSION set `planner.slice_target`= 10000").run();
       String scope = client.queryBuilder()
-              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTION_VAL.getTableName())
+              .sql("SELECT optionScope from sys.%s where name='planner.slice_target'", SystemTable.OPTIONS.getTableName())
               .singletonString();
       Assert.assertEquals("SESSION",scope);
     }
@@ -317,13 +317,13 @@ public void testAlterInternalSystemOption() throws Exception {
          ClientFixture client = cluster.clientFixture()) {
       client.queryBuilder().sql("ALTER SYSTEM SET `%s` = 'bleh'", MOCK_PROPERTY).run();
 
+      client.queryBuilder().sql("SELECT * FROM sys.%s", SystemTable.INTERNAL_OPTIONS_OLD.getTableName()).logCsv();
       client.queryBuilder().sql("SELECT * FROM sys.%s", SystemTable.INTERNAL_OPTIONS.getTableName()).logCsv();
-      client.queryBuilder().sql("SELECT * FROM sys.%s", SystemTable.INTERNAL_OPTIONS_VAL.getTableName()).logCsv();
 
       String mockProp = client.queryBuilder().
-        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS,
MOCK_PROPERTY).singletonString();
+        sql("SELECT string_val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_OLD,
MOCK_PROPERTY).singletonString();
       String mockProp2 = client.queryBuilder().
-        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS_VAL, MOCK_PROPERTY).singletonString();
+        sql("SELECT val FROM sys.%s where name='%s'", SystemTable.INTERNAL_OPTIONS, MOCK_PROPERTY).singletonString();
 
       assertEquals("bleh", mockProp);
       assertEquals("bleh", mockProp2);
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
index 98dbe3fe092..efc8a7b6d58 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
@@ -94,13 +94,13 @@ private void localLoadTestHelper(String propertiesDir) throws Exception
{
          ClientFixture client = cluster.clientFixture()) {
       String parquetPushdown = client.queryBuilder().
         sql("SELECT val FROM sys.%s where name='%s'",
-          SystemTable.OPTION_VAL.getTableName(),
+          SystemTable.OPTIONS.getTableName(),
           PlannerSettings.PARQUET_ROWGROUP_FILTER_PUSHDOWN_PLANNING_THRESHOLD_KEY).
         singletonString();
 
       String plannerWidth = client.queryBuilder().
         sql("SELECT val FROM sys.%s where name='%s'",
-          SystemTable.OPTION_VAL.getTableName(),
+          SystemTable.OPTIONS.getTableName(),
           ExecConstants.MAX_WIDTH_GLOBAL_KEY).
         singletonString();
 
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestSystemTable.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestSystemTable.java
index b5c84c4466a..4f47287aac1 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestSystemTable.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestSystemTable.java
@@ -37,16 +37,16 @@ public static void setupMultiNodeCluster() {
   public void alterSessionOption() throws Exception {
 
     newTest() //
-      .sqlQuery("select bool_val as bool from sys.options where name = '%s' order by accessibleScopes
desc", ExecConstants.JSON_ALL_TEXT_MODE)
+      .sqlQuery("select val as bool from sys.options where name = '%s' order by accessibleScopes
desc", ExecConstants.JSON_ALL_TEXT_MODE)
       .baselineColumns("bool")
       .ordered()
-      .baselineValues(false)
+      .baselineValues(String.valueOf(false))
       .go();
 
     test("alter session set `%s` = true", ExecConstants.JSON_ALL_TEXT_MODE);
 
-    newTest() //
-      .sqlQuery("select bool_val as bool from sys.options where name = '%s' order by accessibleScopes
desc ", ExecConstants.JSON_ALL_TEXT_MODE)
+    newTest() //Using old table to detect both optionScopes: BOOT & SESSION
+      .sqlQuery("select bool_val as bool from sys.options_old where name = '%s' order by
accessibleScopes desc ", ExecConstants.JSON_ALL_TEXT_MODE)
       .baselineColumns("bool")
       .ordered()
       .baselineValues(false)
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java
index e6b1416be00..76c472c3023 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java
@@ -160,12 +160,12 @@ public void tables() throws Exception {
     verifyTable("sys", "boot", tables);
     verifyTable("sys", "drillbits", tables);
     verifyTable("sys", "memory", tables);
-    verifyTable("sys", SystemTable.OPTION.getTableName(), tables);
-    verifyTable("sys", SystemTable.OPTION_VAL.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS_OLD.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS.getTableName(), tables);
     verifyTable("sys", "threads", tables);
     verifyTable("sys", "version", tables);
+    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(), tables);
     verifyTable("sys", SystemTable.INTERNAL_OPTIONS.getTableName(), tables);
-    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(), tables);
   }
 
   @Test
@@ -198,12 +198,12 @@ public void tablesWithSystemTableFilter() throws Exception {
     verifyTable("sys", "boot", tables);
     verifyTable("sys", "drillbits", tables);
     verifyTable("sys", "memory", tables);
-    verifyTable("sys", SystemTable.OPTION.getTableName(), tables);
-    verifyTable("sys", SystemTable.OPTION_VAL.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS_OLD.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS.getTableName(), tables);
     verifyTable("sys", "threads", tables);
     verifyTable("sys", "version", tables);
+    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(), tables);
     verifyTable("sys", SystemTable.INTERNAL_OPTIONS.getTableName(), tables);
-    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(), tables);
   }
 
   @Test
@@ -220,11 +220,11 @@ public void tablesWithTableNameFilter() throws Exception {
 
     verifyTable("sys", "boot", tables);
     verifyTable("sys", "memory", tables);
-    verifyTable("sys", SystemTable.OPTION.getTableName(), tables);
-    verifyTable("sys", SystemTable.OPTION_VAL.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS_OLD.getTableName(), tables);
+    verifyTable("sys", SystemTable.OPTIONS.getTableName(), tables);
     verifyTable("sys", "version", tables);
+    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_OLD.getTableName(), tables);
     verifyTable("sys", SystemTable.INTERNAL_OPTIONS.getTableName(), tables);
-    verifyTable("sys", SystemTable.INTERNAL_OPTIONS_VAL.getTableName(), tables);
   }
 
   @Test


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message