Member since
03-30-2016
9
Posts
0
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
9131 | 04-06-2016 06:35 AM |
04-06-2016
06:35 AM
Yes that was it! TCompactProtocol was the thing to use! Thanks so much for your help Venky
... View more
04-05-2016
02:29 PM
Thanks once again! I was able to remove the query ID from the first part, decode from base64 and get the bytes. I saved it into a file - and it gives me data that I can see. However the thrift binding lookup fails - it says it can't deserialize based on bytes. Exception in thread "main" org.apache.thrift.protocol.TProtocolException: Required field 'nodes' was not present! Struct: TRuntimeProfileTree(nodes:null) at com.cloudera.impala.thrift.TRuntimeProfileTree.validate(TRuntimeProfileTree.java:315) at com.cloudera.impala.thrift.TRuntimeProfileTree$TRuntimeProfileTreeStandardScheme.read(TRuntimeProfileTree.java:381) at com.cloudera.impala.thrift.TRuntimeProfileTree$TRuntimeProfileTreeStandardScheme.read(TRuntimeProfileTree.java:1) at com.cloudera.impala.thrift.TRuntimeProfileTree.read(TRuntimeProfileTree.java:289) at org.apache.thrift.TDeserializer.deserialize(TDeserializer.java:81) at org.apache.thrift.TDeserializer.deserialize(TDeserializer.java:67) at org.tiaa.impala.log.ImpalaLogParser.testTRuntimeProfileTreeSerialization(ImpalaLogParser.java:29) at org.tiaa.impala.log.ImpalaLogParser.main(ImpalaLogParser.java:17) I saved the bytes off to a file - and I can get some information, but it is all encoded with funky characters, ü#,Query (id=4c4d52afea4a40a1:802034563d1cfc93)<AsyncTotalTime InactiveTotalTime TotalTime Summary <AsyncTotalTime InactiveTotalTime TotalTime ˆConnected User Coordinator&denatb31bda01.test.tiaa-cref.org:22000 Default DbdefaultDelegated User End Time2016-03-29 13:47:44.579234000Estimated Per-Host Mem 362807296Estimated Per-Host VCores2ExecSummaryð Operator #Hosts Avg Time Max Time #Rows Est. #Rows Peak Mem Est. Peak Mem Detail --------------------------------------------------------------------------------------------------------------- 06:AGGREGATE 1 130.837ms 130.837ms 1 0 16.00 KB -1.00 B FINALIZE 05:EXCHANGE 1 8.250us 8.250us 1 0 0 -1.00 B UNPARTITIONED 02:AGGREGATE 1 157.644ms 157.644ms 1 0 12.00 KB 10.00 MB 04:AGGREGATE 1 2.452ms 2.452ms 0 0 3.13 MB 10.00 MB 03:EXCHANGE 1 4.584us 4.584us 0 0 0 0 HASH(SSN) 01:AGGREGATE 1 159.257ms 159.257ms 0 0 9.45 MB 10.00 MB 00:SCAN HDFS 1 92.478ms 92.478ms 0 0 9.05 MB 336.00 MB planfocus.enrollments HiveServer2 Protocol VersionV6Impala VersionSimpalad version 2.2.0-cdh5 RELEASE (build 2ffd73a4255cefd521362ffe1cfb37463f67f75c)Network Address10.233.42.16:42229Plan¨ ---------------- I used this code - and it fails. private static void testTRuntimeProfileTreeSerialization() throws Exception { byte[] decodedBytes = Base64.decodeBase64(dataCompressed); InflaterInputStream in = new InflaterInputStream( new ByteArrayInputStream(decodedBytes)); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtils.copy(in, out); byte[] uncompressedBytes = out.toByteArray(); TRuntimeProfileTree aTree = new TRuntimeProfileTree(); TDeserializer dez = new TDeserializer(); dez.deserialize(aTree, uncompressedBytes); } Anything else going on in the serialization process??? Thanks so much for your insights. Venky
... View more
03-31-2016
06:51 AM
Yes I had tried that first. Exception in thread "main" java.util.zip.ZipException: incorrect header check at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164) at java.io.FilterInputStream.read(FilterInputStream.java:107) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025) at org.apache.commons.io.IOUtils.copy(IOUtils.java:999) at org.tiaa.impala.log.ImpalaLogParser.testTRuntimeProfileTreeSerialization(ImpalaLogParser.java:33) at org.tiaa.impala.log.ImpalaLogParser.main(ImpalaLogParser.java:25) That is what led me to this website: http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_logging.html Formerly, the logs contained the query profile for each query, showing low-level details of how the work is distributed among nodes and how intermediate and final results are transmitted across the network. To save space, those query profiles are now stored in zlib-compressed files in/var/log/impala/profiles. You can access them through the Impala web user interface. For example, at http://impalad-node-hostname:25000/queries, each query is followed by a Profile link leading to a page showing extensive analytical data for the query execution. I looked through the impala www code - to see how they deserialize this, but could not figure out. Thanks once again for your help! Venky
... View more
03-30-2016
09:20 AM
Thanks for the tip Bharath. I tried to write a small program to get this string out and read it using thrift bindings. I still get the zip header exception. Any ideas on what I am doing wrong? package org.tiaa.impala.log; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import org.apache.commons.codec.binary.Base64; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.transport.TIOStreamTransport; import org.apache.thrift.transport.TZlibTransport; import com.cloudera.impala.thrift.TRuntimeProfileTree; public class ImpalaLogParser { private static String dataCompressed = "4c4d52afea4a40a1:802034563d1cfc93 eJztPH1sG9d9pPwlU7JsOZFK1ln7VmOxVEj03fFL1CwPFElZWiRKISk7aTYYp+OjdDB5VO6OspUVmLplmZs/PGdxDDfdBgMrjGB1M89eh6TbHK/IsHTtVs9og67dMmAIPC8ZAi/AUq8w1v3euzvy7ngnUV7q2AsPAfXuff2+v947J3B7t3/g0SqWl1GfWBgJC+FChOOLmA/zYYZnh4cYjgmFI9FQgRWKQjzU37M5sM/flVCWJSFfUflSXizjHl+vx+PvnpB4QRWXsK1/q/W919u9yxNo3wUjW3LVcpmXl3s8H8KePce7khVJwoKKC2hWwbKnI1mpyAVR4tWK/HABw9+5EDtX4Bk2qGJFDaoizw8KMi4GK/L8MMcxDONL4SJfLakoNbeloDW7UriE5/naru1pqYAI5J/jGDY6yIQGuThiQ8Ph2HA4HIzE4lwoDDv1phVVLNNlM1geHK8oKprC5a2hKDfExLh4NOAw4WCyImPFy3Wkj2FBZ87NLb7pRSwTIpD27CZzFWgkluYpJtCc4o/pzd3ZylEYhN2DRnsG80cIcL23/prCKi+WkO3xDd7dx8dEhxMHDmTTBxL5tIEEC/+FmOBQKFZWLE19sPYw8BoNMgx6ZNToGmTJO7yOTWQSkxOfSyPL42Miw+nHkuOJzIH6CN1yKMhFmKpiazbAs7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+1Y8fw=="; public static void main(String[] args) throws Exception { byte[] decoded = Base64.decodeBase64(dataCompressed); System.out.println(decoded); ByteArrayInputStream bais = new ByteArrayInputStream(decoded); BufferedInputStream bufferedIn = new BufferedInputStream(bais, 2048); TBinaryProtocol binaryIn = new TBinaryProtocol(new TZlibTransport( new TIOStreamTransport(bufferedIn))); System.out.println("Hello"); TRuntimeProfileTree aTree = new TRuntimeProfileTree(); aTree.read(binaryIn); bais.close(); } } Hello Exception in thread "main" org.apache.thrift.transport.TTransportException: java.util.zip.ZipException: incorrect header check at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129) at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86) at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429) at org.apache.thrift.protocol.TBinaryProtocol.readByte(TBinaryProtocol.java:285) at org.apache.thrift.protocol.TBinaryProtocol.readFieldBegin(TBinaryProtocol.java:243) at com.cloudera.impala.thrift.TRuntimeProfileTree$TRuntimeProfileTreeStandardScheme.read(TRuntimeProfileTree.java:349) at com.cloudera.impala.thrift.TRuntimeProfileTree$TRuntimeProfileTreeStandardScheme.read(TRuntimeProfileTree.java:1) at com.cloudera.impala.thrift.TRuntimeProfileTree.read(TRuntimeProfileTree.java:289) at org.tiaa.impala.log.ImpalaLogParser.main(ImpalaLogParser.java:28) Caused by: java.util.zip.ZipException: incorrect header check at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164) at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127) ... 8 more
... View more
03-30-2016
07:42 AM
Hello fellow members, I see that there is a line entered into the "/var/log/impalad/profiles/" log folder. I see the format of the log is kind of cryptic. The first long number looks like it is an epoch timestamp. The second string looks lilke a base64 encoded string, but it does not represent anything after I decode it. I read the documentation "http://www.cloudera.com/documentation/enterprise/5-5-x/topics/impala_logging.html" It looks like these logs are compressed with zlib? I checked the actual bytes - but none of it makes it look like a zlib compressed string. Can anyone help me with this? I tried to go through the code in C++ and python, but I did not get any clue as to how it is formatted. Here is a sample line: 1458322151442 24496831f65ac754:2ba8e34b4c441c92 eJytVM9T00AUDj9GaoFiHcF2gJn14sAMZJLdTdJ28MDQMHRExAbw4mW7u4Ed0wQ2GxCvXtQ/wBn/Cw8ePPoHON714p+hR7etQOkAJ0/Je5t97/u+972UV0pLzzIuT8GCYI8gxlW3guzQdQj1HFyDLVLhCLcwxdimVbg4PVpeKRVW09OY7iSKRDuizafzM4ZRKjZiQpU45gP525fjmaHirFHOzeqTsSBrt4k8nTb+Q83i28JaEsecKs7AbsqlMb6WJJKJmKhEPmRcP1vIbjFi2abiqTKVIGSZSh6aidyvQWhZVq5e3wQ7p4d8ZDfw83UekixSoN4aY73XQp1HfJ+ct8j5MQMdGPPQst1lCy3bFWCjGqzWbNvEGCKnU3ZuQ1MIuDzmEoJtmaiEJhHY4zIVSTy85xYa7UMSkbNMILohA8e9GEATmtYyZQcOaPqb/mrgg4VWJiIGYBgyDxEMHYfykDnQRq7OcZuGLeRhF4WuF3oOXZza4uokkS/BKmOSp+ld2zIhQiaGpu3WMLLtynjPB4HS/HLrja1GsOHXJy6SWTr89HG+F3c10mLlA12rA7FRf1DB2IOug0KEEbGqqOZVsEdbFrMoI8yusomzjzu3xzcae37gN/f8JpwMjqJe3zaP1WSWcnAYkThMaJbmdV6qG0S2Kp7XEXm0O5Hyn2Ifpksdb5xCX5vzofZx7dfmkiQDo+uCGDDigGkGJ9Fns8s69Pv33Jh6d5ZKRvlWOWeUCv/waaiRiHl5/cuPkZ+/vs59+vh7/vvnN6C8MdVjxV9xmikNr7itZY1FvA9CEYv0gLM7TX6U6W24SOzGku+LVHEJjjr19bpN9Ej2tNPb+uLqbb23FgmNe50revCcCNU5kfro24d3w9fv8v1mcvJEU5aCROI16cA8u3j932PovbFwZbvrqhnGX43whcc= Thanks for your help in advance. Venky
... View more
Labels:
- Labels:
-
Apache Impala