From 016241c49482c7e139833f8ce898a4408371d989 Mon Sep 17 00:00:00 2001 From: Andrei Stefan Date: Sat, 7 Sep 2019 09:14:02 +0300 Subject: [PATCH] Use `null` schema response for `SYS TABLES` command. (#46386) (cherry picked from commit a6152f42a47a1ccd668e5892778c8bd2d3a78c4c) --- .../qa/src/main/resources/setup_mock_metadata_get_tables.sql | 4 ++-- .../main/resources/setup_mock_metadata_get_types_of_table.sql | 4 ++-- .../xpack/sql/plan/logical/command/sys/SysTables.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_tables.sql b/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_tables.sql index db40c6b90865f..1f11c085ee06c 100644 --- a/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_tables.sql +++ b/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_tables.sql @@ -9,7 +9,7 @@ CREATE TABLE mock ( SELF_REFERENCING_COL_NAME VARCHAR, REF_GENERATION VARCHAR ) AS -SELECT '', 'test1', 'BASE TABLE', '', null, null, null, null, null FROM DUAL +SELECT null, 'test1', 'BASE TABLE', '', null, null, null, null, null FROM DUAL UNION ALL -SELECT '', 'test2', 'BASE TABLE', '', null, null, null, null, null FROM DUAL +SELECT null, 'test2', 'BASE TABLE', '', null, null, null, null, null FROM DUAL ; diff --git a/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_types_of_table.sql b/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_types_of_table.sql index db40c6b90865f..1f11c085ee06c 100644 --- a/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_types_of_table.sql +++ b/x-pack/plugin/sql/qa/src/main/resources/setup_mock_metadata_get_types_of_table.sql @@ -9,7 +9,7 @@ CREATE TABLE mock ( SELF_REFERENCING_COL_NAME VARCHAR, REF_GENERATION VARCHAR ) AS -SELECT '', 'test1', 'BASE TABLE', '', null, null, null, null, null FROM DUAL +SELECT null, 'test1', 'BASE TABLE', '', null, null, null, null, null FROM DUAL UNION ALL -SELECT '', 'test2', 'BASE TABLE', '', null, null, null, null, null FROM DUAL +SELECT null, 'test2', 'BASE TABLE', '', null, null, null, null, null FROM DUAL ; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/sys/SysTables.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/sys/SysTables.java index a3b8f1817415d..190224c583c0b 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/sys/SysTables.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plan/logical/command/sys/SysTables.java @@ -146,7 +146,7 @@ public final void execute(SqlSession session, ActionListener listener) { .sorted(Comparator. comparing(i -> legacyName(i.type())) .thenComparing(Comparator.comparing(i -> i.name()))) .map(t -> asList(cluster, - EMPTY, + null, t.name(), legacyName(t.type()), EMPTY,