Skip to content

Conversation

@guoxiaolongzte
Copy link

What changes were proposed in this pull request?

Use 'desc partition_table' command in spark-sql client, i think it should add column head display.

Add 'col_name' ‘data_type’ 'comment' column head display.

fix before:
2

fix after:
1

How was this patch tested?

manual tests

Please review http://spark.apache.org/contributing.html before opening a pull request.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

s"DESC PARTITION is not allowed on a temporary view: ${table.identifier}")
}
describeSchema(catalog.lookupRelation(table).schema, result, header = false)
describeSchema(catalog.lookupRelation(table).schema, result, header = true)
Copy link
Member

Choose a reason for hiding this comment

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

May be should add a configure like hive.cli.print.header.

Copy link
Member

Choose a reason for hiding this comment

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

It's not worth yet another flag, and this is a behavior change in the output. There's no motivation for this change either.

Copy link
Member

@gatorsmile gatorsmile Feb 9, 2018

Choose a reason for hiding this comment

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

For details, see #18203

Copy link
Author

@guoxiaolongzte guoxiaolongzte Feb 11, 2018

Choose a reason for hiding this comment

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

Partition Information

col_name data_type comment

Partition information also takes up two rows.
I try to keep the head of the case, let rows number is displayed correctly.

Copy link
Author

@guoxiaolongzte guoxiaolongzte Feb 11, 2018

Choose a reason for hiding this comment

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

The snapshot is correct fix code effect, the statistics rows does not contain the head
2

Copy link
Member

Choose a reason for hiding this comment

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

@gatorsmile I wasn't clear -- you're saying this change is wrong because it re-adds a header that was removed in the other PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. Hive beeline already hardcoded the header. See the https://issues.apache.org/jira/browse/SPARK-20954

@guoxiaolongzte
Copy link
Author

@srowen @gatorsmile
4

Can I overload hive's org.apache.hive.beeline.Commands.java in spark sql package, modify the hive's hard-coded statistics rows?
0: jdbc:hive2://localhost:18001> desc cyj.partition_table;
+--------------------------+------------+----------+--+
| col_name | data_type | comment |
+--------------------------+------------+----------+--+
| # col_name | data_type | comment |
| id | int | NULL |
| name | string | NULL |
| age | int | NULL |
| dt | string | NULL |
| day | string | NULL |
| hour | int | NULL |
| # Partition Information | | |
| # col_name | data_type | comment |
| dt | string | NULL |
| day | string | NULL |
| hour | int | NULL |
+--------------------------+------------+----------+--+
12 rows selected (0.092 seconds)

| # Partition Information | | |
| # col_name | data_type | comment |
Also counted as two lines. Still in question.

@gatorsmile
Copy link
Member

cc @liufengdb

@liufengdb
Copy link

There may be some spark JDBC/ODBC drivers need to parse the returned results to get all the columns. We should avoid making changes on the returned "schema" from the server side. You can fix the issue on the client side.

@guoxiaolongzte
Copy link
Author

Well, for now, I don't have a better solution.

@srowen srowen mentioned this pull request May 11, 2018
@asfgit asfgit closed this in 348ddfd May 12, 2018
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closes apache#20458
Closes apache#20530
Closes apache#20557
Closes apache#20966
Closes apache#20857
Closes apache#19694
Closes apache#18227
Closes apache#20683
Closes apache#20881
Closes apache#20347
Closes apache#20825
Closes apache#20078

Closes apache#21281
Closes apache#19951
Closes apache#20905
Closes apache#20635

Author: Sean Owen <[email protected]>

Closes apache#21303 from srowen/ClosePRs.
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.

6 participants