You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ErrorCause: {"phase":"query","failed_shards":[{"shard":0,"index":"player_performance","node":"vEp17EizQHuI39IqXskk5w","reason":{"type":"script_exception","reason":"runtime error","script_stack":["wardsScore = (wardsPlaced * 0.5) + (doc['detectorWardsPlaced'] * 0.5);\n double ","^---- HERE"],"script":"String lane = doc['lane'].value; ...","lang":"painless","position":{"offset":545,"start":506,"end":585},"caused_by":{"type":"class_cast_exception","reason":"Cannot apply [*] operation to types [org.elasticsearch.index.fielddata.ScriptDocValues.Longs] and [java.lang.Double]."}}}],"...","type":"script_exception","reason":"runtime error"}]}
에러 원인
Painless 스크립트 실행 중 발생한 script_exception으로, 스크립트에서 런타임 에러가 발생. class_cast_exception이 발생했으며, 데이터 타입 간에 적절하지 않은 연산 시도가 원인
에러의 핵심 내용
Cannot apply [*] operation to types [org.elasticsearch.index.fielddata.ScriptDocValues.Longs] and [java.lang.Double].
이 메시지는 곱셈 연산(*)을 ScriptDocValues.Longs 타입과 java.lang.Double 타입에 적용하려고 시도했으나, 이 두 타입 간에는 곱셈 연산을 직접 수행할 수 없음
문제가 발생한 스크립트 부분
wardsScore = (wardsPlaced * 0.5) + (doc['detectorWardsPlaced'] * 0.5);
여기서 wardsPlaced가 ScriptDocValues.Longs 타입으로 직접적으로 부동소수점 숫자인 0.5와의 곱셈 연산을 시도했기 때문에 타입 불일치로 인한 에러가 발생한 것으로 보임
에러 해결
wardsScore = ((double) wardsPlaced * 0.5) + ((double) doc['detectorWardsPlaced'].value * 0.5);
wardsPlaced와 doc['detectorWardsPlaced'].value를 double 타입으로 명시적으로 캐스팅하여 두 값 모두 부동소수점 연산이 가능한 타입으로 변환한 후 곱셈 연산을 수행
타입을 명확히 지정함으로써 class_cast_exception 에러 해결
The text was updated successfully, but these errors were encountered:
ErrorLog
에러 원인
Painless 스크립트 실행 중 발생한 script_exception으로, 스크립트에서 런타임 에러가 발생. class_cast_exception이 발생했으며, 데이터 타입 간에 적절하지 않은 연산 시도가 원인
에러의 핵심 내용
Cannot apply [*] operation to types [org.elasticsearch.index.fielddata.ScriptDocValues.Longs] and [java.lang.Double].
이 메시지는 곱셈 연산(*)을 ScriptDocValues.Longs 타입과 java.lang.Double 타입에 적용하려고 시도했으나, 이 두 타입 간에는 곱셈 연산을 직접 수행할 수 없음
문제가 발생한 스크립트 부분
wardsScore = (wardsPlaced * 0.5) + (doc['detectorWardsPlaced'] * 0.5);
여기서 wardsPlaced가 ScriptDocValues.Longs 타입으로 직접적으로 부동소수점 숫자인 0.5와의 곱셈 연산을 시도했기 때문에 타입 불일치로 인한 에러가 발생한 것으로 보임
에러 해결
wardsScore = ((double) wardsPlaced * 0.5) + ((double) doc['detectorWardsPlaced'].value * 0.5);
wardsPlaced와 doc['detectorWardsPlaced'].value를 double 타입으로 명시적으로 캐스팅하여 두 값 모두 부동소수점 연산이 가능한 타입으로 변환한 후 곱셈 연산을 수행
타입을 명확히 지정함으로써 class_cast_exception 에러 해결
The text was updated successfully, but these errors were encountered: