Linux 如何从现有配置单元表中读取分区键
我正在尝试将数据从源配置单元表读取到目标配置单元表,这是我创建的配置单元表的一部分 目标配置单元数据库中的表使用源数据库表架构,这样做没有问题 所以我想动态读取分区键并将它们插入load语句中 以便将数据导入到目标表 我想知道是否有人能帮我从现有的表模式中读取分区键 下面是示例表模式Linux 如何从现有配置单元表中读取分区键,linux,shell,hive,hiveql,Linux,Shell,Hive,Hiveql,我正在尝试将数据从源配置单元表读取到目标配置单元表,这是我创建的配置单元表的一部分 目标配置单元数据库中的表使用源数据库表架构,这样做没有问题 所以我想动态读取分区键并将它们插入load语句中 以便将数据导入到目标表 我想知道是否有人能帮我从现有的表模式中读取分区键 下面是示例表模式 hive> describe extended pageviews; OK eventtime string userid
hive> describe extended pageviews;
OK
eventtime string
userid string
page string
dt string
applicationtype string
# Partition Information
# col_name data_type comment
dt string
applicationtype string
Detailed Table Information
Table(tableName:pageviews, dbName:default, owner:root, createTime:1413687270, lastAccessTime:0, retention:0,
sd:StorageDescriptor(cols:[FieldSchema(name:eventtime, type:string, comment:null),
FieldSchema(name:userid, type:string, comment:null),
FieldSchema(name:page, type:string, comment:null), FieldSchema(name:dt, type:string, comment:null),
FieldSchema(name:applicationtype, type:string, comment:null)], location:hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/pageviews,
inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat,
compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null,
serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe,
parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{},
skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}),
storedAsSubDirectories:false), partitionKeys:[FieldSchema(name:dt, type:string, comment:null),
FieldSchema(name:applicationtype, type:string, comment:null)],
parameters:{transient_lastDdlTime=1413687270}, viewOriginalText:null,
viewExpandedText:null, tableType:MANAGED_TABLE)
Time taken: 0.903 seconds, Fetched: 13 row(s)
人们将投票结束这场选举。您需要添加此输入的预期输出,最好是一些显示您试图解决问题的代码。为您的操作系统添加标签也很好,因为windows shell解决方案与*nix解决方案大不相同。祝你好运,对不起。我尝试格式化它,但在保存我的更改时遇到问题,因为我不断看到添加更有意义的注释您的代码消息,这最终不允许我保存格式化文本。现在可能有一个计时器正在编辑您的问题。请在1、4、8、24小时后重试。这可能是因为你只做了空格?因此,集中精力添加所需的输出。祝你好运。为什么你不能简单地把分区理解为“从何处的页面视图中选择不同的dt”?