Closed rzykov closed 2 months ago
Huh that's odd-- I wonder if that is a sqlglot thing, let me try it right quick
yep, it's sqlglot
:
>>> sqlglot.transpile("select regexp_replace('mr .', '[^a-zA-Z]', '', 'g')", read="postgres", write="duckdb")[0]
"SELECT REGEXP_REPLACE('mr .', '[^a-zA-Z]', '')"
let's let them know, assuming that is in fact the wrong thing to do?
@jwills thank you for checking! Let me submit an issue!
By the way, I'm using the buenavista in production for my project :) slide 18 https://docs.google.com/presentation/d/1FwRPP3-O_0t5Xyg0DDB1WccJ8Mnj6pcMkh9W0s2Y_1g/edit?usp=sharing
It was resolved
I'm trying to send regexp queries to a duckdb database via buenavista. But buenavista removes 'g' flag from the function:
INFO:buenavista.postgres:Input SQL: select regexp_replace('mr .', '[^a-zA-Z]', '', 'g') INFO:buenavista.postgres:Rewritten SQL: SELECT REGEXP_REPLACE('mr .', '[^a-zA-Z]', '')