{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/14116","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/14116/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/14116/comments","events_url":"https://api.github.com/repos/apache/spark/issues/14116/events","html_url":"https://github.com/apache/spark/pull/14116","id":164666273,"number":14116,"title":"[SPARK-16452][SQL] Support basic INFORMATION_SCHEMA","user":{"login":"dongjoon-hyun","id":9700541,"avatar_url":"https://avatars.githubusercontent.com/u/9700541?v=3","gravatar_id":"","url":"https://api.github.com/users/dongjoon-hyun","html_url":"https://github.com/dongjoon-hyun","followers_url":"https://api.github.com/users/dongjoon-hyun/followers","following_url":"https://api.github.com/users/dongjoon-hyun/following{/other_user}","gists_url":"https://api.github.com/users/dongjoon-hyun/gists{/gist_id}","starred_url":"https://api.github.com/users/dongjoon-hyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongjoon-hyun/subscriptions","organizations_url":"https://api.github.com/users/dongjoon-hyun/orgs","repos_url":"https://api.github.com/users/dongjoon-hyun/repos","events_url":"https://api.github.com/users/dongjoon-hyun/events{/privacy}","received_events_url":"https://api.github.com/users/dongjoon-hyun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":56,"created_at":"2016-07-09T13:06:37Z","updated_at":"2016-07-26T17:12:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14116","html_url":"https://github.com/apache/spark/pull/14116","diff_url":"https://github.com/apache/spark/pull/14116.diff","patch_url":"https://github.com/apache/spark/pull/14116.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR introduces INFORMATION_SCHEMA, a database consisting views which provide information about all of the tables, views, columns in a database.\r\n\r\n```scala\r\nscala> spark.catalog\r\nscala> sql(\"create table t(a int, b double)\")\r\nscala> sql(\"create view v as select 1\")\r\nscala> sql(\"select * from information_schema.databases\").show()\r\n+------------+------------------+\r\n|CATALOG_NAME|       SCHEMA_NAME|\r\n+------------+------------------+\r\n|     default|           default|\r\n|     default|information_schema|\r\n+------------+------------------+\r\n\r\nscala> sql(\"select * from information_schema.schemata\").show()\r\n+------------+------------------+\r\n|CATALOG_NAME|       SCHEMA_NAME|\r\n+------------+------------------+\r\n|     default|           default|\r\n|     default|information_schema|\r\n+------------+------------------+\r\n\r\nscala> sql(\"select * from information_schema.tables\").show()\r\n+-------------+------------+----------+----------+\r\n|TABLE_CATALOG|TABLE_SCHEMA|TABLE_NAME|TABLE_TYPE|\r\n+-------------+------------+----------+----------+\r\n|      default|     default|         t|     TABLE|\r\n|      default|     default|         v|      VIEW|\r\n+-------------+------------+----------+----------+\r\n\r\nscala> sql(\"select * from information_schema.views\").show()\r\n+-------------+------------+----------+---------------+\r\n|TABLE_CATALOG|TABLE_SCHEMA|TABLE_NAME|VIEW_DEFINITION|\r\n+-------------+------------+----------+---------------+\r\n|      default|     default|         v|           VIEW|\r\n+-------------+------------+----------+---------------+\r\n\r\n\r\nscala> sql(\"select * from information_schema.columns\").show()\r\n+-------------+------------+----------+-----------+----------------+-----------+---------+\r\n|TABLE_CATALOG|TABLE_SCHEMA|TABLE_NAME|COLUMN_NAME|ORDINAL_POSITION|IS_NULLABLE|DATA_TYPE|\r\n+-------------+------------+----------+-----------+----------------+-----------+---------+\r\n|      default|     default|         t|          a|               0|       true|      int|\r\n|      default|     default|         t|          b|               1|       true|   double|\r\n|      default|     default|         v|          1|               0|       true|      int|\r\n+-------------+------------+----------+-----------+----------------+-----------+---------+\r\n\r\nscala> sql(\"select * from information_schema.session_variables\").show(false)\r\n+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n|VARIABLE_NAME                  |VARIABLE_VALUE                                                                                                                               |\r\n+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n|hive.metastore.warehouse.dir   |file:/Users/dongjoon/SPARK-16452-SCHEMA/spark-warehouse                                                                                      |\r\n|spark.app.id                   |local-1468412934354                                                                                                                          |\r\n|spark.app.name                 |Spark shell                                                                                                                                  |\r\n|spark.driver.host              |192.168.0.12                                                                                                                                 |\r\n|spark.driver.memory            |6G                                                                                                                                           |\r\n|spark.driver.port              |56198                                                                                                                                        |\r\n|spark.executor.id              |driver                                                                                                                                       |\r\n|spark.home                     |/Users/dongjoon/SPARK-16452-SCHEMA                                                                                                           |\r\n|spark.jars                     |                                                                                                                                             |\r\n|spark.master                   |local[*]                                                                                                                                     |\r\n|spark.repl.class.outputDir     |/private/var/folders/dc/1pz9m69x14q_gw8t7m143t1c0000gn/T/spark-fd7a86e9-651f-4718-be82-6b84b30a97ac/repl-d4e25a57-c5f1-40d9-809b-1276c55f59c6|\r\n|spark.repl.class.uri           |spark://192.168.0.12:56198/classes                                                                                                           |\r\n|spark.sql.catalogImplementation|hive                                                                                                                                         |\r\n|spark.submit.deployMode        |client                                                                                                                                       |\r\n+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nPass the Jenkins tests including a new testsuite.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/235337900","html_url":"https://github.com/apache/spark/pull/14116#issuecomment-235337900","issue_url":"https://api.github.com/repos/apache/spark/issues/14116","id":235337900,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T17:12:56Z","updated_at":"2016-07-26T17:12:56Z","body":"**[Test build #62897 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62897/consoleFull)** for PR 14116 at commit [`72bc2dd`](https://github.com/apache/spark/commit/72bc2ddae3259c1c223fe0f7a27508f22a7ca11e)."}}
{"actor":{"display_login":"SparkQA"}}