2017-03-14 6 views
0

gzipファイルのMicrosoft.Analytics.Samples.FormatsライブラリからカスタムJsonExtractorを使用しようとしているときに、抽出中に例外が発生します。カスタムJsonExtractorを使用したgzのU-SQL抽出に失敗しました

Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.ScopeDebugExceptionwasunhandledMessage: Anunhandledexceptionoftype'Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.ScopeDebugException'occurredinMicrosoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.dllAdditionalinformation: { 
    "diagnosticCode": 195887142, 
    "severity": "Error", 
    "component": "RUNTIME", 
    "source": "User", 
    "errorId": "E_RUNTIME_USER_UNHANDLED_EXCEPTION_FROM_USER_CODE", 
    "message": "An unhandled exception from user code has been reported when invoking the method 'Extract' on the user type 'Microsoft.Analytics.Samples.Formats.Json.JsonExtractor'", 
    "description": "Unhandled exception from user code: \"Unexpected character encountered while parsing number: j. Path '', line 1, position 33.\"\nThe details includes more information including any inner exceptions and the stack trace where the exception was raised.", 
    "resolution": "Make sure the bug in the user code is fixed.", 
    "helpLink": "", 
    "details": "==== Caught exception Newtonsoft.Json.JsonReaderException 
     at Newtonsoft.Json.JsonTextReader.ReadNumberIntoBuffer() 
     at Newtonsoft.Json.JsonTextReader.ParseNumber(ReadType readType) 
     at Newtonsoft.Json.JsonTextReader.ParseValue() 
     at Microsoft.Analytics.Samples.Formats.Json.JsonExtractor.<Extract>d__2.MoveNext() 
     at ScopeEngine.SqlIpExtractor<ScopeEngine::GZipInput,Extract_0_Data0>.GetNextRow(SqlIpExtractor<ScopeEngine::GZipInput23644,Extract_0_Data0>* , Extract_0_Data0* output) in c:23644projects23644data-insights23644data_insights_ingestion_service23644datainsights.internalbi.scripts23644bin23644debug23644746497ac301de51323644n-populateaccountcurrencycodes.usql.debug_6b364b066929ac9723644sqlmanaged.h:line 1873", 
    "internalDiagnostics": "" 
} 

JSONファイルをgzipで渡すと抽出が成功します。

gsipped csvファイルもテストしましたが、正常に動作しているようです。 これはLocalRun中に発生します。私はまだこの特定のスクリプトをクラウドに提出していません。その問題が発生したときに使用するAzureのデータ湖ツールの

+0

は、あなたが同様にあなたのUSQLスクリプトを共有していただけますか?私は現在、問題なく同じアセンブリを使用しています。 –

+0

@PaulAndrewあなたは 'JsonExtractor'で圧縮(gzip)圧縮アーカイブ(* .tar.gz)を使用していますか? 私がやろうとしています何の例は次のとおりです。新しいMicrosoft.Analytics.Samples.Formats.Json.JsonExtractorを使用して "/ JSON/sampleJsonFiles.tar.gz" @ FROM 'EXTRACT prop_1文字列、 prop_2列 ())AS a ' – sponturious

答えて

0

sponturious、

はどのバージョン(最新は2.2.5000.0ですか)?また、gzipファイルの整合性を検証するために "gzip -t your_gzip_data.gz"を試してください。 Windows用の

gzipのはここから入手することができます:http://gnuwin32.sourceforge.net/packages/gzip.htm

おかげで、 ユー・ドング

+0

最新のバージョンを使用していますが、問題はgzファイルではなく、アーカイブされたエンティティをgzファイルとして読み込みます。 これは、例えば:csv extractorの組み込み抽出プログラムではうまく動作しますが、 'Microsoft.Analytics.Samples.Formats'名前空間に含まれている' JsonExtractor'ではうまく動作しません。 json抽出の前に文脈を解凍してください。 – sponturious

+0

@sponturious gzファイルは、通常オンザフライで解凍する必要があります。私はGitHubのサンプルを試してみましたが、大丈夫です。 'REFERENCE ASSEMBLY JSONBlog。[Newtonsoft.Json];参照アセンブリASON。 USING Microsoft.Analytics.Samples.Formats.Json;新しいJsonExtractor()を使用した @data = EXTRACT ID文字列、 リビジョン文字列、FROM カメラ列 @ "/サンプル/ブログ/ MRys/JSON/camera.json.gz" は; ' –

+0

それはすることができます単一のjsonファイルに対しては行いますが、 "cameras.tar.gz"のように一緒にgzipされた複数のJSONファイルではありません。ここで "cameras.tar"には複数のjsonファイルが含まれます。 – sponturious

関連する問題