[ 
https://issues.apache.org/jira/browse/DRILL-4514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15372184#comment-15372184
 ] 

ASF GitHub Bot commented on DRILL-4514:
---------------------------------------

Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/436#discussion_r70377349
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestInfoSchema.java ---
    @@ -351,4 +359,51 @@ public void showFilesWithDefaultSchema() throws 
Exception{
         test("USE dfs_test.`default`");
         test("SHOW FILES FROM `/tmp`");
       }
    +
    +  @Test
    +  public void describeSchemaSyntax() throws Exception {
    +    test("describe schema dfs_test");
    +    test("describe schema dfs_test.`default`");
    +    test("describe database dfs_test.`default`");
    +  }
    +
    +  @Test
    +  public void describeSchemaOutputForDefaultWorkspace() throws Exception {
    +    String properties = 
Resources.toString(Resources.getResource("describe_schema_output.json"), 
Charsets.UTF_8).replace("\r", "");
    +    testBuilder()
    +        .sqlQuery("describe schema dfs_test")
    +        .unOrdered()
    +        .baselineColumns("schema", "properties")
    +        .baselineValues("dfs_test", properties)
    --- End diff --
    
    I'm not sure if it's a good idea to put the complete "properties" as the 
expected output in unit test. Doing that makes this unit test prone to failure, 
in case we change StoragePlugin interface, and add / delete contents in the 
schema properties. This is similar to Explain Plan output. If we capture 
everything, it becomes annoying in the future, since any slight change to the 
planer might fail the unit test.
    
    In stead of capturing everything, can you just verify some "stable" part of 
properties, like "location" etc, to make this unit test less likely to fail in 
the future?



> Add describe schema <schema_name> command
> -----------------------------------------
>
>                 Key: DRILL-4514
>                 URL: https://issues.apache.org/jira/browse/DRILL-4514
>             Project: Apache Drill
>          Issue Type: New Feature
>    Affects Versions: Future
>            Reporter: Arina Ielchiieva
>            Assignee: Arina Ielchiieva
>
> Add describe database <db_name> command which will return directory 
> associated with a database on the fly.
> Syntax:
> describe database <db_name>
> describe schema <schema_name>
> Output:
> {code:sql}
>  DESCRIBE SCHEMA dfs.tmp;
> {code}
> {noformat}
> +--------+------------+
> | schema | properties |
> +--------+------------+
> | dfs.tmp | {
>   "type" : "file",
>   "enabled" : true,
>   "connection" : "file:///",
>   "config" : null,
>   "formats" : {
>     "psv" : {
>       "type" : "text",
>       "extensions" : [ "tbl" ],
>       "delimiter" : "|"
>     },
>     "csv" : {
>       "type" : "text",
>       "extensions" : [ "csv" ],
>       "delimiter" : ","
>     },
>     "tsv" : {
>       "type" : "text",
>       "extensions" : [ "tsv" ],
>       "delimiter" : "\t"
>     },
>     "parquet" : {
>       "type" : "parquet"
>     },
>     "json" : {
>       "type" : "json",
>       "extensions" : [ "json" ]
>     },
>     "avro" : {
>       "type" : "avro"
>     },
>     "sequencefile" : {
>       "type" : "sequencefile",
>       "extensions" : [ "seq" ]
>     },
>     "csvh" : {
>       "type" : "text",
>       "extensions" : [ "csvh" ],
>       "extractHeader" : true,
>       "delimiter" : ","
>     }
>   },
>   "location" : "/tmp",
>   "writable" : true,
>   "defaultInputFormat" : null
> } |
> +--------+------------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to