Skip to content

geotime predicate fail #61

@MortenHofft

Description

@MortenHofft

below predicate was returned by our API and works for filtering. But it fails when sending it to the sql service
http://api.gbif.org/v1/occurrence/download/request/sql
{
"predicate": {
"type": "equals",
"key": "GEOLOGICAL_TIME",
"value": "Precambrian,Cambrian"
}
}

{
  "reason": "Encountered \",\" at line 1, column 7442.",
  "trace": "org.gbif.api.exception.QueryBuildingException: Encountered \",\" at line 1, column 7442.\n\tat org.gbif.occurrence.query.sql.HiveSqlValidator.validate(HiveSqlValidator.java:289)\n\tat org.gbif.occurrence.query.sql.HiveSqlQuery.<init>(HiveSqlQuery.java:79)\n\tat org.gbif.occurrence.query.sql.HiveSqlQuery.<init>(HiveSqlQuery.java:69)\n\tat org.gbif.occurrence.download.util.SqlValidation.validateAndParse(SqlValidation.java:218)\n\tat org.gbif.occurrence.download.resource.DownloadResource.downloadSqlPost(DownloadResource.java:729)\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\n\tat 

...huge error message...

org.gbif.occurrence.query.sql.HiveSqlValidator.validate(HiveSqlValidator.java:155)\n\t... 187 more\nCaused by: calcite_gbif_shaded.org.apache.calcite.sql.parser.impl.ParseException: Encountered \",\" at line 1, column 7442.\nWas expecting one of:\n    <EOF> \n    \"EXCEPT\" ...\n    \"FETCH\" ...\n    \"GROUP\" ...\n    \"HAVING\" ...\n    \"INTERSECT\" ...\n    \"LIMIT\" ...\n    \"OFFSET\" ...\n    \"ORDER\" ...\n    \"QUALIFY\" ...\n    \"MINUS\" ...\n    \"UNION\" ...\n    \"WINDOW\" ...\n    \".\" ...\n    \"NOT\" ...\n    \"IN\" ...\n    \"<\" ...\n    \"<=\" ...\n    \">\" ...\n    \">=\" ...\n    \"=\" ...\n    \"<>\" ...\n    \"!=\" ...\n    \"BETWEEN\" ...\n    \"LIKE\" ...\n    \"ILIKE\" ...\n    \"RLIKE\" ...\n    \"SIMILAR\" ...\n    \"+\" ...\n    \"-\" ...\n    \"*\" ...\n    \"/\" ...\n    \"%\" ...\n    \"||\" ...\n    \"AND\" ...\n    \"OR\" ...\n    \"IS\" ...\n    \"MEMBER\" ...\n    \"SUBMULTISET\" ...\n    \"CONTAINS\" ...\n    \"OVERLAPS\" ...\n    \"EQUALS\" ...\n    \"PRECEDES\" ...\n    \"SUCCEEDS\" ...\n    \"IMMEDIATELY\" ...\n    \"MULTISET\" ...\n    \"[\" ...\n    \"FORMAT\" ...\n    \"(\" ...\n    \n\tat calcite_gbif_shaded.org.apache.calcite.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:41363)\n\tat calcite_gbif_shaded.org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:41174)\n\tat calcite_gbif_shaded.org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:4087)\n\tat calcite_gbif_shaded.org.apache.calcite.sql.parser.impl.SqlParserImpl.parseSqlStmtEof(SqlParserImpl.java:204)\n\tat calcite_gbif_shaded.org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:172)\n\t... 188 more\n",
  "status": "INVALID"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions