【问题标题】:What is the Presto query to get the data type of a particular column in a particular table?获取特定表中特定列的数据类型的 Presto 查询是什么?
【发布时间】:2021-11-06 15:07:26
【问题描述】:

或者,获取特定表中特定列的数据类型的 Hive 查询是什么?

【问题讨论】:

    标签: sql hadoop hive presto sqldatatypes


    【解决方案1】:

    您可以使用typeof 函数来获取列或表达式的类型:

    SELECT typeof(column) FROM t
    

    【讨论】:

    • 这似乎只有在表中有数据时才有效。如果此查询返回 0 行怎么办?如果表中没有数据怎么办?我们如何获取列的类型?
    猜你喜欢
    • 2017-11-30
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 2018-08-27
    • 2020-10-16
    • 1970-01-01
    • 2020-03-18
    • 2019-05-09
    相关资源
    最近更新 更多