Comments (2)
Not able to repro this issue in main branch for field type Integer on JDBC response format
curl -X POST "http://localhost:9200/_plugins/_sql?format=jdbc" -H "Content-Type: application/json" -d '{
> "query": "SELECT count(*) FROM test100 where status != 200"}'
{
"schema": [
{
"name": "count(*)",
"type": "integer"
}
],
"datarows": [
[
1
]
],
"total": 1,
"size": 1,
"status": 200
But I see if we use a field type text
and use the count(*)
with !=
operator the below error -
curl -X POST "http://localhost:9200/_plugins/_sql?format=jdbc" -H "Content-Type: application/json" -d '{
> "query": "SELECT count(*) FROM test100 where ImageType != \"machine\""
> }'
{
"error": {
"reason": "Error occurred in OpenSearch engine: all shards failed",
"details": "Shard[0]: java.lang.IllegalArgumentException: Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [ImageType] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\n\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.",
"type": "SearchPhaseExecutionException"
},
"status": 400
In JSON format
curl -X POST "http://localhost:9200/_plugins/_sql?format=json" -H "Content-Type: application/json" -d '{
> "query": "SELECT count(*) FROM test100 where ImageType != \"machine\""
> }'
{
"error": {
"reason": "Invalid SQL query",
"details": "Unsupported operation: !=",
"type": "SqlParseException"
},
"status": 400
}
So it appears is users are using the count(*) aggregation query with negation operator on text fields, the error is expected as it is not recommended to use the aggregation on text fields.
But for Integer fields, issue cannot be reproduced.
from sql.
Not able to repro for field type "keyword" on latest branch
curl -X GET "http://localhost:9200/test200/_mapping"
{"test200":{"mappings":{"properties":{"ImageType":{"type":"keyword"}}}}}
curl -X POST "http://localhost:9200/_plugins/_sql?format=jdbc" -H "Content-Type: application/json" -d '{
> "query": "SELECT count(*) FROM test200 where ImageType != \"machine\""}'
{
"schema": [
{
"name": "count(*)",
"type": "integer"
}
],
"datarows": [
[
1
]
],
"total": 1,
"size": 1,
"status": 200
}
from sql.
Related Issues (20)
- [BUG] Restrict UDF functions in spark SQL.
- [BUG] Invalid aggregation statement should throw SemanticCheckException HOT 1
- [RFC] Make aggregation statement compilation robust HOT 1
- [FEATURE] Long polling support for async queries HOT 1
- [BUG] _id is not available in PPL where condition
- [AUTOCUT] Distribution Build Failed for sql-2.15.1 HOT 24
- [BUG] REGEXP filter failed due to IllegalStateException
- Case insensitive text search SQL HOT 4
- [BUG] Inaccurate PPL query results due to plugins.query.size_limit restriction HOT 1
- [BUG] Query anonymization doesn't work in fallback log HOT 1
- [FEATURE] Support line comment and block comment in PPL
- [AUTOCUT] Integration Test failed for sql: 1.3.18 HOT 4
- [FEATURE] Support nested aggregation
- [FEATURE]Move PPL Language Spec Outside SQL As an independed Repository HOT 1
- [BUG] Numbers in scientific notation can not be recognized in PPL
- [FEATURE] Integrate job scheduler plugin
- [FEATURE] Introduce scheduling service
- [BUG]Should we use `Locale.ENGLISH` for monthName/dayName function HOT 4
- [FEATURE] PPL parse command should support substring match
- CVE-2024-6345 (High) detected in setuptools-68.0.0-py3-none-any.whl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql.