kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [38/50] [abbrv] incubator-kylin git commit: minor bug fix, JDBC KylinMeta to report correct catalog metadata
Date Fri, 10 Jul 2015 23:27:24 GMT
minor bug fix, JDBC KylinMeta to report correct catalog metadata


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/ce77dd29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/ce77dd29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/ce77dd29

Branch: refs/heads/0.7
Commit: ce77dd29264bf932b4fe58e9a1de4e405846b691
Parents: b28e9f4
Author: Li, Yang <yangli9@ebay.com>
Authored: Mon Jul 6 13:39:49 2015 +0800
Committer: Li, Yang <yangli9@ebay.com>
Committed: Mon Jul 6 13:50:16 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/jdbc/KylinMeta.java     | 18 ++++++++++++------
 .../java/org/apache/kylin/jdbc/DriverTest.java    |  3 +++
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ce77dd29/jdbc/src/main/java/org/apache/kylin/jdbc/KylinMeta.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinMeta.java b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinMeta.java
index 72d7fb1..821fba5 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinMeta.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinMeta.java
@@ -89,19 +89,19 @@ public class KylinMeta extends MetaImpl {
     @Override
     public MetaResultSet getCatalogs() {
         List<KMetaCatalog> catalogs = getMetaProject().catalogs;
-        return createResultSet(catalogs, MetaCatalog.class, "TABLE_CATALOG");
+        return createResultSet(catalogs, KMetaCatalog.class, "TABLE_CAT");
     }
 
     @Override
     public MetaResultSet getSchemas(String catalog, Pat schemaPattern) {
         List<KMetaSchema> schemas = getMetaProject().getSchemas(catalog, schemaPattern);
-        return createResultSet(schemas, MetaSchema.class, "TABLE_SCHEM", "TABLE_CATALOG");
+        return createResultSet(schemas, KMetaSchema.class, "TABLE_SCHEM", "TABLE_CATALOG");
     }
 
     @Override
     public MetaResultSet getTables(String catalog, Pat schemaPattern, Pat tableNamePattern,
List<String> typeList) {
         List<KMetaTable> tables = getMetaProject().getTables(catalog, schemaPattern,
tableNamePattern, typeList);
-        return createResultSet(tables, MetaTable.class, //
+        return createResultSet(tables, KMetaTable.class, //
                 "TABLE_CAT", //
                 "TABLE_SCHEM", //
                 "TABLE_NAME", //
@@ -117,7 +117,7 @@ public class KylinMeta extends MetaImpl {
     @Override
     public MetaResultSet getColumns(String catalog, Pat schemaPattern, Pat tableNamePattern,
Pat columnNamePattern) {
         List<KMetaColumn> columns = getMetaProject().getColumns(catalog, schemaPattern,
tableNamePattern, columnNamePattern);
-        return createResultSet(columns, MetaColumn.class, //
+        return createResultSet(columns, KMetaColumn.class, //
                 "TABLE_CAT", //
                 "TABLE_SCHEM", //
                 "TABLE_NAME", //
@@ -285,13 +285,19 @@ public class KylinMeta extends MetaImpl {
         }
     }
 
-    public static class KMetaCatalog extends MetaCatalog implements NamedWithChildren {
+    public static class KMetaCatalog implements NamedWithChildren {
+        public final String tableCat;
         public final List<KMetaSchema> schemas;
 
         public KMetaCatalog(String tableCatalog, List<KMetaSchema> schemas) {
-            super(tableCatalog);
+            this.tableCat = tableCatalog;
             this.schemas = schemas;
         }
+        
+        @Override
+        public String getName() {
+            return tableCat;
+        }
 
         @Override
         public List<? extends NamedWithChildren> getChildren() {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ce77dd29/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
----------------------------------------------------------------------
diff --git a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java b/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
index c17efb1..3a2ef75 100644
--- a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
+++ b/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
@@ -100,14 +100,17 @@ public class DriverTest {
 
         ResultSet catalogs = conn.getMetaData().getCatalogs();
         System.out.println("CATALOGS");
+        printResultSetMetaData(catalogs);
         printResultSet(catalogs);
 
         ResultSet schemas = conn.getMetaData().getSchemas();
         System.out.println("SCHEMAS");
+        printResultSetMetaData(schemas);
         printResultSet(schemas);
 
         ResultSet tables = conn.getMetaData().getTables(null, null, null, null);
         System.out.println("TABLES");
+        printResultSetMetaData(tables);
         printResultSet(tables);
 
         for (int j = 0; j < 3; j++) {


Mime
View raw message