spark运行结果通过saveAsTable写入表中之后,在spark-sql可以正常查询,在hive客户端select返回为空,查看desc formatted tablename; 其中的Detailed Table Information 中的Location显示的不是hdfs的路径,很奇怪,这个需要怎样修改呢
hive> desc formatted pca_svm_result;
OK
# col_name data_type comment
label double
prediction double
# Detailed Table Information
Database: default
Owner: hadoop
CreateTime: Mon Sep 03 15:45:05 CST 2018
LastAccessTime: UNKNOWN
Retention: 0
Location: file:/mnt/hadoop/hadoop-2.6.5/hdfs/tmp/nm-local-dir/usercache/hadoop/appcache/application_1534325481078_0318/container_1534325481078_0318_01_000001/spark-warehouse/pca_svm_result
Table Type: MANAGED_TABLE
Table Parameters:
spark.sql.create.version 2.3.0
spark.sql.sources.provider parquet
spark.sql.sources.schema.numParts 1
spark.sql.sources.schema.part.0 {\"type\":\"struct\",\"fields\":[{\"name\":\"label\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"prediction\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}}]}
transient_lastDdlTime 1535960705
# Storage Information
SerDe Library: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
InputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
Compressed: No
Num Buckets: -1
Bucket Columns: []
Sort Columns: []
Storage Desc Params:
path hdfs://master:9000/user/hive/warehouse/pca_svm_result
serialization.format 1
Time taken: 0.073 seconds, Fetched: 31 row(s)
|