{"record":{"id":"d7434cbce4ff1289","repo":"prestodb/presto","slug":"invalid-arguments-d7434c","errorCode":"INVALID_ARGUMENTS","errorMessage":"Elasticsearch query for '%s' is not base32-encoded correctly","messagePattern":"Elasticsearch query for '(.+?)' is not base32-encoded correctly","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchMetadata.java","lineNumber":135,"sourceCode":"\n    @Override\n    public ElasticsearchTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)\n    {\n        requireNonNull(tableName, \"tableName is null\");\n        if (tableName.getSchemaName().equals(schemaName)) {\n            String[] parts = tableName.getTableName().split(\":\", 2);\n            String table = parts[0];\n            Optional<String> query = Optional.empty();\n            ElasticsearchTableHandle.Type type = SCAN;\n            if (parts.length == 2) {\n                if (table.endsWith(PASSTHROUGH_QUERY_SUFFIX)) {\n                    table = table.substring(0, table.length() - PASSTHROUGH_QUERY_SUFFIX.length());\n                    byte[] decoded;\n                    try {\n                        decoded = BaseEncoding.base32().decode(parts[1].toUpperCase(ENGLISH));\n                    }\n                    catch (IllegalArgumentException e) {\n                        throw new PrestoException(INVALID_ARGUMENTS, format(\"Elasticsearch query for '%s' is not base32-encoded correctly\", table), e);\n                    }\n\n                    String queryJson = new String(decoded, UTF_8);\n                    try {\n                        // Ensure this is valid json\n                        JSON_PARSER.readTree(queryJson);\n                    }\n                    catch (JsonProcessingException e) {\n                        throw new PrestoException(INVALID_ARGUMENTS, format(\"Elasticsearch query for '%s' is not valid JSON\", table), e);\n                    }\n\n                    query = Optional.of(queryJson);\n                    type = QUERY;\n                }\n                else {\n                    query = Optional.of(parts[1]);\n                }\n            }","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchMetadata.java#L117-L153","documentation":"Table-handle parsing guard: the portion of the table name after ':' (the passthrough query) is not valid base32 as required by the connector's naming convention, so it cannot be decoded into a query string.","triggerScenarios":"Thrown at presto-elasticsearch/src/main/java/com/facebook/presto/elasticsearch/ElasticsearchMetadata.java:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-generate the passthrough query table name using base32 encoding","Ensure the query text was base32-encoded without padding/character loss"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}