Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.
Spark+S2RDF queryTranslator실행시 NullPointerException가 발생전에 java.lang.ArrayIndexOutOfBoundsException발생시 조치사항
실행문 : java -jar ./queryTranslator-1.1.0.jar -i ./test3/test3.sparql -o ./test3/test3.sparql -sd ./test3/statistics/ -sUB 0.2
==> java.lang.ArrayIndexOutOfBoundsException발생시 stat_vp.txt파일의 값이 tab으로 분리 되어 있는지 확인하고 tab으로 분리되어
있지 않으면 tab으로 분리 하고 저장해준다(vi에서 :set list 하면 tab문자와 줄끝 제어문자를 볼수 있다)
----------------------------------------오류메세지의 일부 --------------
inputFile- =================>./test3/test3.sparql
18:25:28 DEBUG Main :: inputFile-- =================>./test3/test3.sparql
18:25:28 DEBUG JenaIOEnvironment :: Failed to find configuration: location-mapping.ttl;location-mapping.rdf;location-mapping.n3;etc/location-mapping.rdf;etc/location-mapping.n3;etc/location-mapping.ttl
Exception occurred trying to read './test3/statistics//stat_vp.txt'.java.lang.ArrayIndexOutOfBoundsException: 3
at queryTranslator.SparkTableStatistics.readVPStatistic(SparkTableStatistics.java:210)
at queryTranslator.SparkTableStatistics.init(SparkTableStatistics.java:40)
at queryTranslator.Translator.translateQuery(Translator.java:122)
at queryTranslator.run.Main.main(Main.java:79)
VP STAT Size = 1
OS STAT Size = 0
SO STAT Size = 0
SS STAT Size = 4
THE NUMBER OF ALL SAVED (< ScaleUB) TRIPLES IS -> 3
THE NUMBER OF ALL SAVED (< ScaleUB) TABLES IS -> 1
TABLE-><http__//www.w3.org/1999/02/22-rdf-syntax-ns#type>
Exception in thread "main" java.lang.NullPointerException
at queryTranslator.SparkTableStatistics.determineBestCandidateTable(SparkTableStatistics.java:302)
at queryTranslator.op.SqlBGP.translate(SqlBGP.java:76)
at queryTranslator.SqlOpTranslator.visit(SqlOpTranslator.java:127)
at queryTranslator.op.SqlBGP.visit(SqlBGP.java:141)
at queryTranslator.SqlOpWalker.visit0(SqlOpWalker.java:78)
at queryTranslator.SqlOpVisitorByType.visit(SqlOpVisitorByType.java:62)
at queryTranslator.op.SqlBGP.visit(SqlBGP.java:141)
at queryTranslator.SqlOpWalker.visit1(SqlOpWalker.java:91)
at queryTranslator.SqlOpVisitorByType.visit(SqlOpVisitorByType.java:93)
at queryTranslator.op.SqlProject.visit(SqlProject.java:59)
at queryTranslator.SqlOpWalker.walkBottomUp(SqlOpWalker.java:68)
at queryTranslator.SqlOpTranslator.translate(SqlOpTranslator.java:73)
at queryTranslator.Translator.translateQuery(Translator.java:237)
at queryTranslator.run.Main.main(Main.java:79)