2017-08-08 10 views
1

私はs3でファイルをgzipしましたが、ファイルにはprotobufメッセージのバイト配列を表すエンコードされたBase64文字列が含まれています。私は地元からflatMap機能については、次の火花コードを実行している場合spark-submit protobuf openrtb java.lang.VerifyError

syntax = "proto2"; 
package com.myproject.proto; 
option java_outer_classname = "MyProtos"; 
import "openrtb.proto"; 

message Request { 
    optional int64 timestamp = 1; 
    optional com.google.openrtb.BidRequest bidRequest = 2; 
    optional string otherData = 3; 
} 

: プロトスキームは次のようになります

public static Iterator<MyProtos.Request> parseRequest(String source) { 
    try { 
     byte[] bytes = Base64.decodeBase64(source); 
     MyProtos.Request request = MyProtos.Request.parseFrom(bytes); 
     return Collections.singletonList(request).iterator(); 
    } catch (Exception e) { 
     return Collections.emptyIterator(); 
    } 
} 

すべてがOKですが、私は私が火花提出することにより、リモートでコードを実行しようとすると、例外が発生しました:

java.lang.VerifyError: Bad type on operand stack 
Exception Details: 
    Location: 
    com/google/protobuf/GeneratedMessageV3$ExtendableMessage.hasExtension(Lcom/google/protobuf/GeneratedMessage$GeneratedExtension;)Z @2: invokevirtual 
    Reason: 
    Type 'com/google/protobuf/GeneratedMessage$GeneratedExtension' (current frame, stack[1]) is not assignable to 'com/google/protobuf/ExtensionLite' 
    Current Frame: 
    bci: @2 
    flags: { } 
    locals: { 'com/google/protobuf/GeneratedMessageV3$ExtendableMessage', 'com/google/protobuf/GeneratedMessage$GeneratedExtension' } 
    stack: { 'com/google/protobuf/GeneratedMessageV3$ExtendableMessage', 'com/google/protobuf/GeneratedMessage$GeneratedExtension' } 
    Bytecode: 
    0x0000000: 2a2b b600 21ac 

答えて

0

問題は、デフォルトでは、変数spark.executor.userClassPathFirstが偽等しいランタイム的環境にありました。 クライアントモードでリモートまたはローカルでスパークを実行した場合、そのような依存関係の競合の問題はありませんでした。

関連する問題