Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Implicit cast to timestamp does not work on text filed #2437

Open
penghuo opened this issue Nov 22, 2023 · 0 comments
Open

[BUG] Implicit cast to timestamp does not work on text filed #2437

penghuo opened this issue Nov 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@penghuo
Copy link
Collaborator

penghuo commented Nov 22, 2023

What is the bug?

  • Implicit cast to timestamp does not work for Text field.
select textDate from index where timestamp(textDate) >= \"2023-11-22 23:39:00.000\"
  • log
onException[compare expected value have same type, but with [org.opensearch.sql.opensearch.data.type.OpenSearchTextType@512e772, TIMESTAMP]]; }
        at org.opensearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:687)
        at org.opensearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:376)
        at org.opensearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:726)
        at org.opensearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:495)
        at org.opensearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:298)
        at org.opensearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:104)
        at org.opensearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:74)
        at org.opensearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:755)
        at org.opensearch.transport.TransportService$6.handleException(TransportService.java:884)
        at org.opensearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1504)
        at org.opensearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1618)
        at org.opensearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1592) 
        at org.opensearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:79)
        at org.opensearch.transport.TransportChannel.sendErrorResponse(TransportChannel.java:71)
        at org.opensearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:70)
        at org.opensearch.action.ActionRunnable.onFailure(ActionRunnable.java:103)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:54)
        at org.opensearch.threadpool.TaskAwareRunnable.doRun(TaskAwareRunnable.java:78)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
        at org.opensearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:59)
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:917)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: NotSerializableExceptionWrapper[expression_evaluation_exception: compare expected value have same type, but with [org.opensearch.sql.opensearch.data.type.OpenSearchTextType@6c396a95, TIMESTAMP]] 
        at org.opensearch.sql.data.model.AbstractExprValue.compareTo(AbstractExprValue.java:30)
        at org.opensearch.sql.data.model.AbstractExprValue.compareTo(AbstractExprValue.java:14)
        at org.opensearch.sql.expression.operator.predicate.BinaryPredicateOperator.lambda$gte$95048fc1$1(BinaryPredicateOperator.java:203)
        at org.opensearch.sql.expression.function.FunctionDSL.lambda$nullMissingHandling$a5005281$1(FunctionDSL.java:412)
        at org.opensearch.sql.expression.function.FunctionDSL.lambda$impl$a0fb34d4$1(FunctionDSL.java:285)
        at org.opensearch.sql.expression.function.FunctionDSL$3.valueOf(FunctionDSL.java:166)
        at org.opensearch.sql.opensearch.storage.script.filter.ExpressionFilterScript.evaluateExpression(ExpressionFilterScript.java:48)
        at org.opensearch.sql.opensearch.storage.script.core.ExpressionScript.lambda$execute$2(ExpressionScript.java:85)
        at java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.opensearch.sql.opensearch.storage.script.core.ExpressionScript.execute(ExpressionScript.java:82)
        at org.opensearch.sql.opensearch.storage.script.filter.ExpressionFilterScript.execute(ExpressionFilterScript.java:43)
        at org.opensearch.index.query.ScriptQueryBuilder$ScriptQuery$1$1.matches(ScriptQueryBuilder.java:226)
        at org.apache.lucene.search.ConjunctionDISI$ConjunctionTwoPhaseIterator.matches(ConjunctionDISI.java:346)
        at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreRange(Weight.java:281)
        at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:254)
        at org.opensearch.search.internal.CancellableBulkScorer.score(CancellableBulkScorer.java:71)
        at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:38)
        at org.opensearch.search.internal.ContextIndexSearcher.searchLeaf(ContextIndexSearcher.java:316)
        at org.opensearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:276)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:551)
        at org.opensearch.search.query.QueryPhase.searchWithCollector(QueryPhase.java:360)
        at org.opensearch.search.query.QueryPhase$DefaultQueryPhaseSearcher.searchWithCollector(QueryPhase.java:447)
        at org.opensearch.search.query.QueryPhase$DefaultQueryPhaseSearcher.searchWith(QueryPhase.java:431)
        at org.opensearch.search.query.QueryPhaseSearcherWrapper.searchWith(QueryPhaseSearcherWrapper.java:64)
        at org.opensearch.search.query.QueryPhase.executeInternal(QueryPhase.java:282)
        at org.opensearch.search.query.QueryPhase.execute(QueryPhase.java:155)
        at org.opensearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:532)
        at org.opensearch.search.SearchService.executeQueryPhase(SearchService.java:596)
        at org.opensearch.search.SearchService$2.lambda$onResponse$0(SearchService.java:565)
        at org.opensearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:73)
        at org.opensearch.action.ActionRunnable$2.doRun(ActionRunnable.java:88)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
        at org.opensearch.threadpool.TaskAwareRunnable.doRun(TaskAwareRunnable.java:78)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
        at org.opensearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:59)
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:917)
        at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.lang.Thread.run(Thread.java:833)
@penghuo penghuo added bug Something isn't working untriaged labels Nov 22, 2023
@dai-chen dai-chen removed the untriaged label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants