hive - How to count the column in hive
问题描述
I need the count of columns in hive ,So below is the example.
Table_name:emp
columns: empno, ename, manager, dept_id
Expected output: 4
解决方案
Hive (now) supports the information_schema tables, so you could do:
select count(*)
from information_schema.columns
where table_name = 'emp'
推荐阅读
- php - symfony/panther 是否有可能等待某些元素 n 次?
- reactjs - React 应用程序演练的设计方法建议
- git - 有没有最好的方法来分析 git repo 中的 c 源文件中的不稳定函数?
- r - 根据R中的另一个逻辑列表替换列表中的逻辑元素
- python - 运行多处理代码时 Pandas Dataframe 不更新
- json - 使用 jq 在 windows cmd 中为特殊字符更正嵌套对象的配额设置
- bash - 如何将语法高亮添加到 make 错误消息中?
- visual-studio - Visual Studio 2019 - 数据集表适配器在每个存储过程名称后添加“;1”
- html - React-Quill delta to html with custom css without using any package
- asp.net - 覆盖 Azure 应用设置中的 appsettings.json 值