Re: Display column data type without code

2018-04-28 Thread Paul Rogers
Turns out I really needed better type functions in order to explain the nuances of Drill types, so I went ahead and created them. See DRILL-6361, PR #1242 [1]. Examples shown in the PR. Reviewers very much appreciated. Thanks, - Paul [1] https://github.com/apache/drill/pull/1242 On Sat

Re: Display column data type without code

2018-04-28 Thread Charles Givre
I’d like to weigh in here, but this would be EXTREMELY useful. When I was trying to write connectors to enable various BI tools to connect to Drill, such as SQLPad and Metabase, the inability to get information about how drill interprets the data was really difficult to get around. Just me .02

Re: Display column data type without code

2018-04-28 Thread Paul Rogers
Hi Rob, Thanks for the suggestion. While this works for Hive (as you showed), it does not work for CSV files: DESCRIBE `csvh/cust.csvh`; +--++--+ | COLUMN_NAME  | DATA_TYPE  | IS_NULLABLE  | +--++--+ +--+

Re: Display column data type without code

2018-04-26 Thread Paul Rogers
Thanks! A it turns out, typeof() is not documented on the Apache Drill website which is why I was confused. Maybe we should document it. Just tried typeof(). Turns out it only returns the type, not the nullability or repeated mode. Is there a separate function to get the "mode" information? -

Re: Display column data type without code

2018-04-26 Thread Rob Wu
Hi Paul, You could also use DESCRIBE (https://drill.apache.org/docs/describe/). 0: jdbc:drill:drillbit=localhost:31010> describe `hive.default`.`integer_table` . . . . . . . . . . . . . . . . . . . > ; +--++--+ | COLUMN_NAME | DATA_TYPE | IS_N

Re: Display column data type without code

2018-04-25 Thread Abhishek Girish
Hey Paul, You could use the typeof() function for this purpose. It takes a single parameter - the column name. For example: > select typeof(c_current_cdemo_sk) from customer limit 1; +-+ | EXPR$0 | +-+ | BIGINT | +-+ 1 row selected (0.472 seconds) On Wed, Apr 25, 2018

Re: Display column data type without code

2018-04-25 Thread Aman Sinha
You can do it through SQL using typeof() function. Since there is no global schema, Drill evaluates this for each row. 0: jdbc:drill:drillbit=10.10.101.41> select n_name, typeof(n_name) as name_type, n_nationkey, typeof(n_nationkey) as nationkey_type from cp.`tpch/nation.parquet` limit 2; *+

Display column data type without code

2018-04-25 Thread Paul Rogers
Hi All, Anyone know if there is a non-code way to display the data types of columns returned from a Drill query? Sqlline appears to only show the column names and values. The same is true of the Drill web console. The EXPLAIN PLAN FOR ... command shows the query plan, but not type (which are onl