Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-3087] Improve DESC FORMATTED output #2908

Closed
wants to merge 3 commits into from

Conversation

jackylk
Copy link
Contributor

@jackylk jackylk commented Nov 8, 2018

Change output of DESC FORMATTED to:

+----------------------------+-------------------------------------------------------------------------------------+-------+
|col_name                    |data_type                                                                            |comment|
+----------------------------+-------------------------------------------------------------------------------------+-------+
|shortfield                  |smallint                                                                             |null   |
|intfield                    |int                                                                                  |null   |
|bigintfield                 |bigint                                                                               |null   |
|doublefield                 |double                                                                               |null   |
|stringfield                 |string                                                                               |null   |
|timestampfield              |timestamp                                                                            |null   |
|decimalfield                |decimal(18,2)                                                                        |null   |
|datefield                   |date                                                                                 |null   |
|charfield                   |string                                                                               |null   |
|floatfield                  |double                                                                               |null   |
|                            |                                                                                     |       |
|## Table Basic Information  |                                                                                     |       |
|Comment                     |                                                                                     |       |
|Path                        |/Users/jacky/code/carbondata/examples/spark2/target/store/default/carbonsession_table|       |
|Table Block Size            |1024 MB                                                                              |       |
|Table Blocklet Size         |64 MB                                                                                |       |
|Streaming                   |false                                                                                |       |
|Flat Folder                 |false                                                                                |       |
|Bad Record Path             |                                                                                     |       |
|Min Input Per Node          |0.0B                                                                                 |       |
|                            |                                                                                     |       |
|## Index Information        |                                                                                     |       |
|Sort Scope                  |LOCAL_SORT                                                                           |       |
|Sort Columns                |stringfield,timestampfield,datefield,charfield                                       |       |
|Index Cache Level           |BLOCK                                                                                |       |
|Cached Index Columns        |All columns                                                                          |       |
|                            |                                                                                     |       |
|## Encoding Information     |                                                                                     |       |
|Local Dictionary Enabled    |true                                                                                 |       |
|Local Dictionary Threshold  |10000                                                                                |       |
|Local Dictionary Include    |stringfield                                                                          |       |
|                            |                                                                                     |       |
|## Compaction Information   |                                                                                     |       |
|MAJOR_COMPACTION_SIZE       |1024                                                                                 |       |
|AUTO_LOAD_MERGE             |false                                                                                |       |
|COMPACTION_LEVEL_THRESHOLD  |4,3                                                                                  |       |
|COMPACTION_PRESERVE_SEGMENTS|0                                                                                    |       |
|ALLOWED_COMPACTION_DAYS     |0                                                                                    |       |
|                            |                                                                                     |       |
|## Dynamic Information      |                                                                                     |       |
|Table Data Size             |2.93KB                                                                               |       |
|Table Index Size            |1.53KB                                                                               |       |
|Last Update Time            |Wed Nov 07 17:16:01 CST 2018                                                         |       |
+----------------------------+-------------------------------------------------------------------------------------+-------+
  • Any interfaces changed?

  • Any backward compatibility impacted?

  • Document update required?

  • Testing done
    Please provide details on
    - Whether new unit test cases have been added or why no new tests are required?
    - How it is tested? Please attach test report.
    - Is it a performance related change? Please attach the performance test report.
    - Any additional information to help reviewers in testing this change.

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1331/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9590/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1542/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1333/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1544/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9592/

@zzcclp
Copy link
Contributor

zzcclp commented Nov 8, 2018

Hi @jackylk :
I have some questions shown below:

  1. How to show external info if it's an external table?
  2. It need to show the partition info if it has partition columns;
  3. missing property: DICTIONARY_INCLUDE;
  4. doesn't it show database and table name?
  5. will remove NO_INVERTED_INDEX ? right?
  6. doesn't it show default value for each properties? and as our discussion, we need to save the default value to schema info even user doesn't set the value, is this done?

@jackylk
Copy link
Contributor Author

jackylk commented Nov 9, 2018

@zzcclp

  1. I think we can show the table path
  2. The current DESC already has the logic to show partition info, this part is not changed
  3. DICTIONARY_INCLUDE is added in encoding section
  4. Since the DESC syntax includes database name and table name, so I think it is not required to show them again.
  5. yes, INVERTED_INDEX is added in [CARBONDATA-3065]make inverted index false by default #2886
  6. It is not done, and in this PR the most important table property is shown, it will show default value is user did not specify the property when creating table.

Will fix according to these comments and push again

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1338/

@jackylk
Copy link
Contributor Author

jackylk commented Nov 9, 2018

@zzcclp currently, it will show

+-------------------------------+------------------------------------------------------------------------------------------------+----------+--+
|           col_name            |                                           data_type                                            | comment  |
+-------------------------------+------------------------------------------------------------------------------------------------+----------+--+
| l_partkey                     | int                                                                                            | null     |
| l_suppkey                     | string                                                                                         | null     |
| l_linenumber                  | int                                                                                            | null     |
| l_quantity                    | double                                                                                         | null     |
| l_extendedprice               | double                                                                                         | null     |
| l_discount                    | double                                                                                         | null     |
| l_tax                         | double                                                                                         | null     |
| l_returnflag                  | string                                                                                         | null     |
| l_linestatus                  | string                                                                                         | null     |
| l_shipdate                    | date                                                                                           | null     |
| l_commitdate                  | date                                                                                           | null     |
| l_receiptdate                 | date                                                                                           | null     |
| l_shipinstruct                | string                                                                                         | null     |
| l_shipmode                    | string                                                                                         | null     |
| l_comment                     | string                                                                                         | null     |
| l_orderkey                    | int                                                                                            | null     |
|                               |                                                                                                |          |
| ## Table Basic Information    |                                                                                                |          |
| Path                          | /Users/jacky/code/spark-2.2.1-bin-hadoop2.7/carbonstore/tpchcarbon_base/lineitem_hash_no_sort  |          |
| External                      | true                                                                                           |          |
| Transactional                 | true                                                                                           |          |
| Flat Folder                   | false                                                                                          |          |
| Streaming                     | false                                                                                          |          |
| Table Block Size              | 128 MB                                                                                         |          |
| Table Blocklet Size           | 64 MB                                                                                          |          |
| Comment                       |                                                                                                |          |
| Bad Record Path               |                                                                                                |          |
| Min Input Per Node            | 0.0B                                                                                           |          |
|                               |                                                                                                |          |
| ## Index Information          |                                                                                                |          |
| Sort Scope                    | no_sort                                                                                        |          |
| Sort Columns                  | l_orderkey                                                                                     |          |
| Index Cache Level             | BLOCK                                                                                          |          |
| Cached Index Columns          | All columns                                                                                    |          |
|                               |                                                                                                |          |
| ## Encoding Information       |                                                                                                |          |
| Local Dictionary Enabled      | true                                                                                           |          |
| Local Dictionary Threshold    | 10000                                                                                          |          |
| Local Dictionary Include      | l_suppkey,l_returnflag,l_linestatus,l_shipinstruct,l_shipmode,l_comment                        |          |
| Global Dictionary             |                                                                                                |          |
|                               |                                                                                                |          |
| ## Compaction Information     |                                                                                                |          |
| MAJOR_COMPACTION_SIZE         | 1024                                                                                           |          |
| AUTO_LOAD_MERGE               | false                                                                                          |          |
| COMPACTION_LEVEL_THRESHOLD    | 4,3                                                                                            |          |
| COMPACTION_PRESERVE_SEGMENTS  | 0                                                                                              |          |
| ALLOWED_COMPACTION_DAYS       | 0                                                                                              |          |
|                               |                                                                                                |          |
| ## Partition Information      |                                                                                                |          |
| Partition Type                | HASH                                                                                           |          |
| Partition Columns             | l_orderkey:INT                                                                                 |          |
| Number of Partitions          | 6                                                                                              |          |
| Partitions Ids                | 0,1,2,3,4,5                                                                                    |          |
|                               |                                                                                                |          |
| ## Dynamic Information        |                                                                                                |          |
| Table Data Size               | 226.26MB                                                                                       |          |
| Table Index Size              | 13.71KB                                                                                        |          |
| Last Update Time              | Thu Nov 08 19:31:30 CST 2018                                                                   |          |
+-------------------------------+------------------------------------------------------------------------------------------------+----------+--+

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9597/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1549/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1347/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9606/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1558/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1348/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1350/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1560/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9608/

@zzcclp
Copy link
Contributor

zzcclp commented Nov 9, 2018

@jackylk it now looks good to me, you added database and table name in the latest commit , right?

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1352/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1562/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9610/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1385/

fix compile

fix comment

fix comment

fix test

fix test

fix test

wip

fix test
@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1386/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1596/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9644/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1391/

@CarbonDataQA
Copy link

Build Failed with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9649/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1601/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1401/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1611/

@CarbonDataQA
Copy link

Build Success with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9659/

@xuchuanyin
Copy link
Contributor

LGTM

@asfgit asfgit closed this in 851dd2c Nov 15, 2018
}
return cachedColsList;
} else {
return new LinkedList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not required to create LinkedList here. we can return cachedColsList directly

asfgit pushed a commit that referenced this pull request Nov 21, 2018
Change output of DESC FORMATTED

This closes #2908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants