0
2つのdiffソースから2つのデータセットをHiveにスクープします。私は、列の上の文字列のインデックスのようないくつかの分析機能を実行するためにHiveContextによってpysparkにこの表を使用しHadoopでpysparkを実行しているときにファイル例外ではない
create table db.table as select table 1 union select table 2
を使用してハイブ内の2つのテーブルの和を作成しました。
hc=HiveContext(sc)
data = hc.sql("select * from db.table")
from pyspark.sql import SQLContext, Row, HiveContext
from pyspark.ml.feature import StringIndexer
indexer = StringIndexer(inputCol="col_cat", outputCol="cat_indexed")
indexed=indexer.fit(data).transform(data)
私はだから私はHDFS
hadoop fs -ls /hive/db/table
に行き、私はテーブルを見つけ、次のエラー
py4j.protocol.Py4JJavaError: An error occurred while calling o63.fit.
: java.io.IOException: Not a file:
を取得しかし、私はここでいただきました!問題を知りません。 私は外部表を作成しなかったので、私はそれを感じる。前回は外部なしで動いた。
'data.first()'は何もしていませんか? – ShuaiYuan
いいえ、同じエラーが表示されます –
sparkで[テーブルを読み込み](http://spark.apache.org/docs/1.6.2/sql-programming-guide.html#hive-tables)しましたか? – ShuaiYuan