[
https://issues.apache.org/jira/browse/DRILL-7485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995692#comment-16995692
]
ASF GitHub Bot commented on DRILL-7485:
---------------------------------------
cgivre commented on pull request #1932: DRILL-7485: NPE on PCAP Batch Reader
URL: https://github.com/apache/drill/pull/1932
The Drill PCAP reader was throwing a NPE if it encountered a packet with a
null IP address. This phenomenon can occur in ARP packets before IP addresses
are resolved to MAC addresses.
The PR adds a function to `Packet.java` that checks whether the IP address
is `null`, and if is, returns an empty string. If the IP addresses are
populated, it returns the String version of the IP address.
https://github.com/cgivre/drill/blob/93e0275280e88a0a83aa4fc7e6f0ed907ac576d7/exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java#L186-#L202
I added a small test file, as well as a new unit test to confirm the
functionality.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> NPE on PCAP Batch Reader
> ------------------------
>
> Key: DRILL-7485
> URL: https://issues.apache.org/jira/browse/DRILL-7485
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.17.0
> Reporter: Charles Givre
> Assignee: Charles Givre
> Priority: Blocker
> Attachments: test1.pcap, test2.pcap
>
>
> PcapBatchReader throws NPE with certain files.
> {{apache drill> select * from dfs.test.`test1.pcap`;
> Error: EXECUTION_ERROR ERROR: null
> Read failed for reader PcapBatchReader
> Fragment 0:0
> [Error Id: 24f85130-5a1c-4478-b52e-780e537d8ffb on localhost:31010]
> (java.lang.NullPointerException) null
> org.apache.drill.exec.store.pcap.PcapBatchReader.addDataToTable():409
> org.apache.drill.exec.store.pcap.PcapBatchReader.parseNextPacket():337
> org.apache.drill.exec.store.pcap.PcapBatchReader.next():194
>
> org.apache.drill.exec.physical.impl.scan.framework.ShimBatchReader.next():132
> org.apache.drill.exec.physical.impl.scan.ReaderState.readBatch():414
> org.apache.drill.exec.physical.impl.scan.ReaderState.next():371
> org.apache.drill.exec.physical.impl.scan.ScanOperatorExec.nextAction():263
> org.apache.drill.exec.physical.impl.scan.ScanOperatorExec.next():234
> org.apache.drill.exec.physical.impl.protocol.OperatorDriver.doNext():196
> org.apache.drill.exec.physical.impl.protocol.OperatorDriver.start():174
> org.apache.drill.exec.physical.impl.protocol.OperatorDriver.next():124
>
> org.apache.drill.exec.physical.impl.protocol.OperatorRecordBatch.next():150
> org.apache.drill.exec.record.AbstractRecordBatch.next():128
> org.apache.drill.exec.record.AbstractRecordBatch.next():118
> org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():65
>
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():144
> org.apache.drill.exec.record.AbstractRecordBatch.next():188
> org.apache.drill.exec.physical.impl.BaseRootExec.next():105
>
> org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():83
> org.apache.drill.exec.physical.impl.BaseRootExec.next():95
> org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():296
> org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():283
> java.security.AccessController.doPrivileged():-2
> javax.security.auth.Subject.doAs():422
> org.apache.hadoop.security.UserGroupInformation.doAs():1730
> org.apache.drill.exec.work.fragment.FragmentExecutor.run():283
> org.apache.drill.common.SelfCleaningRunnable.run():38
> java.util.concurrent.ThreadPoolExecutor.runWorker():1149
> java.util.concurrent.ThreadPoolExecutor$Worker.run():624
> java.lang.Thread.run():748 (state=,code=0)}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)