Hi Prof Chris, Done with Jira: https://issues.apache.org/jira/browse/OODT-766. This happens with the SQL Query only, not with the Lucene. At least no exception is thrown out in Lucene queries.
By the way, maybe I am using the wrong syntax, but it seems the Lucene is much difficult to use than Sql. For example: Suppose I have 3 files with the GenericFile type: $ ./query_tool --url http://localhost:9000 --sql -query "SELECT CAS.ProductReceivedTime,CAS.ProductName,CAS.ProductId,ProductType,ProductTypeId,ProductTypeName,ProductStructure,Filename,FileLocation,MimeType FROM GenericFile" -sortBy 'CAS.ProductReceivedTime' -outputFormat '$CAS.ProductReceivedTime,$CAS.ProductName,$CAS.ProductId,$ProductType,$ProductTypeId,$ProductTypeName,$ProductStructure,$Filename,$FileLocation,$MimeType' Oct 28, 2014 3:51:31 PM org.apache.oodt.cas.filemgr.system.XmlRpcFileManager complexQuery INFO: Query returned 3 results 2014-09-15T12:41:31.241-07:00,blah.txt,4ad79161-3d10-11e4-b2be-cf9a90c3077d,GenericFile,GenericFileId,GenericFileName,Flat,blah.txt,/Users/AngelaWang/files/blah.txt,text/plain,text,plain 2014-10-13T22:04:28.703-07:00,hello.txt,93586611-535f-11e4-9209-4d1d47528f7d,GenericFile,GenericFileId,GenericFileName,Flat,hello.txt,/Users/AngelaWang/files/hello.txt,text/plain,text,plain 2014-10-27T23:31:54.319-07:00,concatenatedOutputFile-2014-10-28T06:31:53.597Z.txt,1bc212ba-5e6c-11e4-84b4-f5653df4b171,GenericFile,FileConcatenatorProductType,GenericFile,FileConcatenatorProductTypeId,GenericFile,FileConcatenatorProductTypeName,Flat,concatenatedOutputFile-2014-10-28T06:31:53.597Z.txt,concatenatedOutputFile-2014-10-28T06:31:53.597Z.txt,/Users/AngelaWang/files/concatenatedOutputFile-2014-10-28T06:31:53.597Z.txt,text/plain,text,plain All the flowing 4 Lucene queries return 0 record. $./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductTypeName:GenericFile' $./query_tool --url http://localhost:9000 --lucene -query 'ProductTypeName:GenericFile' $./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductTypeName:GenericFileName' $./query_tool --url http://localhost:9000 --lucene -query 'ProductTypeName:GenericFileName' Oct 28, 2014 3:57:09 PM org.apache.oodt.cas.filemgr.catalog.LuceneCatalog paginateQuery WARNING: Query: [q=CAS.ProductTypeName:GenericFile] for Product Type: [urn:oodt:GenericFile] returned no results Only this one gives me the correct result: $./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductName:blah.txt' 4ad79161-3d10-11e4-b2be-cf9a90c3077d Thanks. Best, Mengying (Angela) Wang On Tue, Oct 28, 2014 at 7:24 AM, Chris Mattmann <[email protected]> wrote: > Thanks for reporting this Angela. It would be great if you can > file an issue for this in JIRA? Does this happen with the SQL > Query only, or does it do so also with Lucene? > > Cheers, > Chris > > ------------------------ > Chris Mattmann > [email protected] > > > > > -----Original Message----- > From: Mengying Wang <[email protected]> > Reply-To: <[email protected]> > Date: Tuesday, October 28, 2014 at 12:10 AM > To: <[email protected]> > Subject: Error occurs when using the query_tool script of the file manager > for a new product type > > >Hi Everyone, > > > >According to the tutorial > >http://oodt.apache.org/components/maven/curator/user/basic.html, I added > a > >new JSON product type to my file manager. However, if I run the query_tool > >script before any json files ingested, it will raise some errors, as shown > >here: > > > >$ ./query_tool --url http://localhost:9000 --sql -query "SELECT * FROM > >JSON" > >Oct 27, 2014 11:52:07 PM org.apache.oodt.cas.filemgr.catalog.LuceneCatalog > >paginateQuery > >WARNING: Query: [q=] for Product Type: [urn:example:JSON] returned no > >results > >java.lang.NullPointerException > >at > >org.apache.oodt.cas.filemgr.system.XmlRpcFileManager.complexQuery(XmlRpcFi > >leManager.java:602) > >at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) > >at > >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm > >pl.java:43) > >at java.lang.reflect.Method.invoke(Method.java:606) > >at org.apache.xmlrpc.Invoker.execute(Invoker.java:130) > >at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84) > >at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:146) > >at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139) > >at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:125) > >at org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:761) > >at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:642) > >at java.lang.Thread.run(Thread.java:744) > >org.apache.xmlrpc.XmlRpcException: java.lang.Exception: > >org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException: Failed to > >perform complex query : null > >at > >org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClie > >ntResponseProcessor.java:104) > >at > >org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClien > >tResponseProcessor.java:71) > >at > >org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:73) > >at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) > >at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) > >at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) > >at > >org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient.complexQuery(Xm > >lRpcFileManagerClient.java:990) > >at > >org.apache.oodt.cas.filemgr.tools.QueryTool.performSqlQuery(QueryTool.java > >:252) > >at org.apache.oodt.cas.filemgr.tools.QueryTool.main(QueryTool.java:242) > >Exception in thread "main" > >org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException: > >java.lang.Exception: > >org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException: Failed to > >perform complex query : null > >at > >org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient.complexQuery(Xm > >lRpcFileManagerClient.java:996) > >at > >org.apache.oodt.cas.filemgr.tools.QueryTool.performSqlQuery(QueryTool.java > >:252) > >at org.apache.oodt.cas.filemgr.tools.QueryTool.main(QueryTool.java:242) > > > >By the way, if some files with the product type JSON are already ingested > >in my file manager, then the query_tool script works very well. > > > >Thanks. > >Mengying (Angela) Wang > > > -- Best, Mengying (Angela) Wang
