2017-10-03 5 views
1

스파크 - 쉘에서 createGlobalTempView() 및 createOrReplaceGlobalTempView() 메소드는 데이터 세트에 사용할 수 없습니다. 아무도 이것이 이것이 사실 일 것이라고 말할 수 있습니까? 분명히 spark-shell에서도 spark.newSession과 같이 새로운 세션을 생성 할 수 있습니다. 그렇다면이 두 가지 방법을 사용할 수없는 이유는 무엇입니까?스파크 : 스파크 - 쉘에서 createGlobalTempView() 메소드를 사용할 수없는 이유

scala> spark.range(100).create 
createOrReplaceTempView createTempView 

scala> spark.range(100).create 

답변

1

reateGlobalTempViewspark-shell 다른 상황 사이에는 차이가 없다 스파크 2.1 이후에서 사용할 수 있습니다 : 아래의 코드는 내가 무슨 뜻인지를 보여줍니다. 을 부를 수 없다면 방법을 사용하면 Spark 2.0을 사용하게 될 것입니다. 그렇지 않으면 단지 완주입니다 :

Welcome to 
     ____    __ 
    /__/__ ___ _____/ /__ 
    _\ \/ _ \/ _ `/ __/ '_/ 
    /___/ .__/\_,_/_/ /_/\_\ version 2.2.0 
     /_/ 

Using Scala version 2.11.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_141) 
Type in expressions to have them evaluated. 
Type :help for more information. 

scala> spark.range(100).createGlobalTempView("foo") 

scala> 
관련 문제