Add Cursor.describe to retrieve the schema of a query#302
Merged
Conversation
hovaesco
reviewed
Dec 14, 2022
| schema='tiny', | ||
| table='nation', | ||
| type='varchar(152)', | ||
| type_size=0, |
Contributor
Author
There was a problem hiding this comment.
I'm not exactly sure it is returned by DESCRIBE OUTPUT
❯ trino
trino> prepare test FROM select * from tpch.tiny.customer;
PREPARE
trino> describe output test;
Column Name | Catalog | Schema | Table | Type | Type Size | Aliased
-------------+---------+--------+----------+--------------+-----------+---------
custkey | tpch | tiny | customer | bigint | 8 | false
name | tpch | tiny | customer | varchar(25) | 0 | false
address | tpch | tiny | customer | varchar(40) | 0 | false
nationkey | tpch | tiny | customer | bigint | 8 | false
phone | tpch | tiny | customer | varchar(15) | 0 | false
acctbal | tpch | tiny | customer | double | 8 | false
mktsegment | tpch | tiny | customer | varchar(10) | 0 | false
comment | tpch | tiny | customer | varchar(117) | 0 | false
(8 rows)
Query 20221214_180638_00003_8aypw, FINISHED, 1 node
Splits: 1 total, 1 done (100,00%)
0,72 [0 rows, 0B] [0 rows/s, 0B/s]
b3c7e06 to
5986f18
Compare
hovaesco
approved these changes
Dec 19, 2022
5986f18 to
82b4dbd
Compare
hashhar
approved these changes
Dec 20, 2022
Member
hashhar
left a comment
There was a problem hiding this comment.
LGTM
Looks useful. Similar to ResultSetMetaData from JDBC land.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Non-technical explanation
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: