Hello, can anyone suggest how to query string that...
# general
j
Hello, can anyone suggest how to query string that has apostrophe in it like
McDonald's - Nadd Al Hamar
?
l
Replace the apostrophe with this sequence: '\''
j
Copy code
select * from food_am_final
where 1=1
and brand_name IN ('McDonald'\''s - Nadd Al Hamar')
tried with this still an error, can you suggest correct syntax @Lewis Yobs
e
does
''
work? That's standard sql escaping for single quotes...
j
Copy code
select * from food_am_final
where 1=1
and brand_name IN ('McDonald''s - Nadd Al Hamar')
tried this but no luck
💡 1
e
does
\'
work?
if that doesn't work, maybe try`concat`?
j
@Elon its a value in record, i don’t think concat will work.
\'
is not working as well
💡 1
thanks @Elon, this is working fine
Copy code
select * from default.food_am_final
where brand_name IN ('McDonald''s - Nadd Al Hamar')
@Elon we need to fix trino pinot read part , trino is not able to parse this but it is working on pinot UI.
e
what error do you get in trino? I will try to repro
j
Copy code
io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Bad request
	at io.grpc.Status.asRuntimeException(Status.java:535)
	at io.grpc.stub.ClientCalls$BlockingResponseStream.hasNext(ClientCalls.java:648)
	at io.trino.plugin.pinot.client.PinotGrpcDataFetcher$PinotGrpcServerQueryClient$ResponseIterator.computeNext(PinotGrpcDataFetcher.java:274)
	at io.trino.plugin.pinot.client.PinotGrpcDataFetcher$PinotGrpcServerQueryClient$ResponseIterator.computeNext(PinotGrpcDataFetcher.java:261)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:146)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:141)
	at io.trino.plugin.pinot.client.PinotGrpcDataFetcher.endOfData(PinotGrpcDataFetcher.java:85)
	at io.trino.plugin.pinot.PinotSegmentPageSource.getNextPage(PinotSegmentPageSource.java:117)
	at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:301)
	at io.trino.operator.Driver.processInternal(Driver.java:394)
	at io.trino.operator.Driver.lambda$process$8(Driver.java:297)
	at io.trino.operator.Driver.tryWithLock(Driver.java:689)
	at io.trino.operator.Driver.process(Driver.java:289)
	at io.trino.operator.Driver.processForDuration(Driver.java:260)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:773)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:165)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:523)
	at io.trino.$gen.Trino_407____20231107_172806_2.run(Unknown Source)
	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:840)
Query used:
Copy code
select * from pinot.default.food_am_final
where brand_name IN ('McDonald''s - Nadd Al Hamar')
LIMIT 1001
@Elon
e
Thanks! Is brand name a single value column or multi value?
j
its is multiple value column
💡 1
e
ok, that really helps! Will attempt a repro - which version of trino are you on?
j
its 407 and using your branch
pinot-insert
@Elon any update, its a production issue at our end
e
and pinot 0.12.1?
I will look into it shortly and let you know.
j
Pinot is 0.11
But at pinot UI is working fine
e
ah, both are older versions, I will update you: if anything I can patch a newer version of trino to work w pinot 0.11 - will try that.
j
Yes please
I can update trino version from your branch
👍 1
e
sounds good!
j
@Elon any update?
e
Not yet, but I will let you know when I get to it, hopefully in the next few days.