Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Dedup crashes with ClassCastException

Aperta
#5,614 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@dai-chen ci sta già lavorando.

Dal 14/7/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug PPL
Bug Report

Describe the bug:

PPL DEDUP command crashes with a ClassCastException when:

  1. The dedup pushdown path is taken (composite aggregation + top_hits) — i.e., no WHERE clause precedes DEDUP
  2. The index contains any field whose _source representation is a non-primitive (Map/Object), such as geo_point stored as {"lat":..., "lon":...} or object-type fields

The top_hits response parser appears to iterate over _source fields and assumes all values are String, but encounters HashMap values from structured field types.

OpenSearch version: 3.7.0 (also reproduces on 3.4.0 with the reversed cast direction)
SQL plugin version: 3.7.0.0

Reproduction

Minimal reproduction:

# Create index with a geo_point field (stored as object in _source)
PUT test_dedup_geo
{
  "mappings": {
    "properties": {
      "name": { "type": "keyword" },
      "location": { "type": "geo_point" }
    }
  }
}

POST test_dedup_geo/_bulk
{"index":{}}
{"name":"alice","location":{"lat":40.7,"lon":-74.0}}
{"index":{}}
{"name":"bob","location":{"lat":34.0,"lon":-118.2}}
{"index":{}}
{"name":"alice","location":{"lat":51.5,"lon":-0.1}}

POST test_dedup_geo/_refresh

# This FAILS:
POST _plugins/_ppl
{"query": "SOURCE = test_dedup_geo | DEDUP name | FIELDS name"}

# This WORKS (WHERE clause prevents dedup pushdown):
POST _plugins/_ppl
{"query": "SOURCE = test_dedup_geo | WHERE name IS NOT NULL | DEDUP name | FIELDS name"}
On 3.7.0:
{
  "error": {
    "reason": "java.sql.SQLException: exception while executing query: class java.util.HashMap cannot be cast to class java.lang.String (java.util.HashMap and java.lang.String are in module java.base of loader 'bootstrap')",
    "type": "RuntimeException"
  },
  "status": 500
}
On 3.4.0:
{
  "error": {
    "reason": "java.sql.SQLException: exception while executing query: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')",
    "type": "RuntimeException"
  },
  "status": 500
}
Lingua principale
Java
Stelle
175
Fork
233
Merge medio
2g 16h
PR unite (30g)
39

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opensearch-project/sql

Tutte le issue di opensearch-project/sql

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.