2015-01-23 12 views
1

docker에서 pyspark를 실행 중입니다. 나는 pyspark로 기본적인 작업을 할 수있다. 하지만 SQL 쿼리를 실행하려고 할 때, 나는 예외pyspark에서 sql 쿼리를 실행하는 동안 MetaException (message : java.lang.IllegalArgumentException : java.net.UnknownHostException)

[IN] from pyspark.sql import SQLContext, HiveContext 
    sqlContext = HiveContext(sc) 
    rdd = sqlContext.parquetFile("/2014122x.parquet") 
    rdd.count() 
[OUT] 53855299L 

다음 얻을하지만 난 다음 쿼리를 실행할 때, 나는

[IN] rdd.registerAsTable("tweets") 
    sqlContext.sql("drop table if exists tweets_filtered") 
    %time sqlContext.sql("create table tweets_filtered as "\ 
      +" select floor(cast(timestamp_ms as decimal)/(900*1000)) as ts, source"\ 
      +", user.geo_enabled, user.followers_count, user.friends_count, user.id"\ 
      +", user.lang, user.location, user.verified"\ 
      +" from tweets a where timestamp_ms is not null") 
sqlContext.cacheTable("tweets_filtered") 

    Py4JJavaError: An error occurred while calling o18.sql. 
: org.apache.spark.sql.execution.QueryExecutionException: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.IllegalArgumentException: java.net.UnknownHostException: 3f8c07a0e645) 
    at org.apache.spark.sql.hive.HiveContext.runHive(HiveContext.scala:309) 
    at org.apache.spark.sql.hive.HiveContext.runSqlHive(HiveContext.scala:276) 
    at org.apache.spark.sql.hive.execution.DropTable.sideEffectResult$lzycompute(commands.scala:58) 
    at org.apache.spark.sql.hive.execution.DropTable.sideEffectResult(commands.scala:56) 
    at org.apache.spark.sql.execution.Command$class.execute(commands.scala:46) 
    at org.apache.spark.sql.hive.execution.DropTable.execute(commands.scala:51) 
    at org.apache.spark.sql.SQLContext$QueryExecution.toRdd$lzycompute(SQLContext.scala:425) 
    at org.apache.spark.sql.SQLContext$QueryExecution.toRdd(SQLContext.scala:425) 
    at org.apache.spark.sql.SchemaRDDLike$class.$init$(SchemaRDDLike.scala:58) 
    at org.apache.spark.sql.SchemaRDD.<init>(SchemaRDD.scala:108) 
    at org.apache.spark.sql.hive.HiveContext.sql(HiveContext.scala:94) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231) 
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379) 
    at py4j.Gateway.invoke(Gateway.java:259) 
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133) 
    at py4j.commands.CallCommand.execute(CallCommand.java:79) 
    at py4j.GatewayConnection.run(GatewayConnection.java:207) 
    at java.lang.Thread.run(Thread.java:744) 

누군가가이 문제를 해결하는 데 도움 주실 래요 다음과 같은 오류가 얻을? 최근에 고정 표시기를 업그레이드 (또는 가능하게 고정 표시기 기계를 위해 boot2docker에서 마이그레이션)가 작업 디렉토리에 metastore_db 이전 고정 표시기의 VM의 호스트 이름을 사용하여 구성 가능성이있는 경우

답변

0

(3f8c07a0e645?)를

이 문제를 해결하려면 내 독에 관한 문제, metastore_db를 완전히 삭제하고 그것을 다시 만들었으며 명령을 다시 시도 할 때 모든 것이 원활하게 진행되었습니다. 그래도 그것을 처리하는 더 좋은 방법이있을 수 있습니다.