StructType schema = hiveContext.sql(“select * from XX.XX limit 0”).schema();
就可以获得schema 。
本文介绍了一种通过执行Hive SQL语句来快速获取表结构(schema)的方法,使用limit 0确保不会返回实际数据行。
StructType schema = hiveContext.sql(“select * from XX.XX limit 0”).schema();
就可以获得schema 。
776

被折叠的 条评论
为什么被折叠?