2017-03-20 14 views
0

Mobius HiveDataFrameの例を実行しようとしていますが、実行できません。JVMメソッドの実行に失敗しました:パラメータなしで呼び出された場合、クラス14の非静的メソッドのロードに失敗しました

 var jsonFilePath = "file:///C:/Mobius/build/runtime/data/people.json"; 
     const string dbName = "SampleHiveDataBaseForMobius"; 
     const string tableName = "people"; 

     var builder = SparkSession.Builder().EnableHiveSupport(); 
     // The following setting is required to use Spark 2.0 in Windows 
     // It may be provided in command line when running Mobius app 
     //builder = builder.Config("spark.sql.warehouse.dir", "<hdfs or local path>"); 
     var session = builder.GetOrCreate(); 
     var peopleDataFrame = session.Read().Json(jsonFilePath); 
     session.Sql(string.Format("CREATE DATABASE IF NOT EXISTS {0}", dbName)); // create database if not exists 
     session.Sql(string.Format("USE {0}", dbName)); 
     //hiveContext.Sql(string.Format("DROP TABLE {0}", tableName)); // drop table if exists 

     peopleDataFrame.Write().Mode(SaveMode.Overwrite).SaveAsTable(tableName); // create table 
     var tablesDataFrame = session.Table(tableName); // get all tables in database 
     logger.LogInfo(string.Format("table count in database {0}: {1}", dbName, tablesDataFrame.Count())); 
     tablesDataFrame.Show(); 

     session.Sql(string.Format("SELECT * FROM {0}", tableName)).Show(); // select from table 

私は

var peopleDataFrame = session.Read().Json(jsonFilePath); 

ソース@エラーを取得しています:Microsoft.Spark.CSharp.Adapter

メッセージ:JVMメソッドの実行に失敗しました:非静的メソッドの負荷がクラス14で失敗しました何と呼ばれていない場合パラメータ

ここにスタックトレースがあります。

Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallJavaMethod(Boolean isStatic, Object classNameOrJvmObjectReference, String methodName, Object[] parameters) 
Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallNonStaticJavaMethod(JvmObjectReference objectId, String methodName) 
Microsoft.Spark.CSharp.Proxy.Ipc.DataFrameReaderIpcProxy.Load() 
Microsoft.Spark.CSharp.Sql.DataFrameReader.Load() 
Microsoft.Spark.CSharp.Sql.DataFrameReader.Load(String path) 
Microsoft.Spark.CSharp.Sql.DataFrameReader.Json(String path) 
DemoSparkHiveDataFrame.Program.Main(String[] args) in e:\Work\Feb\VS 2012\DemoSparkHiveDataFrame\DemoSparkHiveDataFrame\Program.cs:line 26 
System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
System.Threading.ThreadHelper.ThreadStart() 
+0

Spark&Mobiusのどのバージョンをお使いですか?あなたはMobiusのリリースでバイナリを使用していますか? – skaarthik

+0

スパークバージョンは2.0.0で、mobiusディレクトリはGithub Microsoft/Mobiusからダウンロードしました –

答えて

0

私は私がちょうど設定spark.sql.warehouse.dirパスとその作品私のために細かいため

builder.config("spark.sql.warehouse.dir","file:///C:/spark-warehouse") 

を設定するために必要なソリューションを得ました。

関連する問題