Hi Pedro, A quick check reveals that the DATE_TRUNC function isn’t yet supported for BigQuery. I’ll look into this soon, this week. This is a great example where you could work around the current limitation using a ParseListener, as I mentioned in my previous email.
The cast is translated correctly. The GROUP BY 1, 2 semantics (referencing projected column expressions by index or alias from GROUP BY) is something we’ve been asked for a few times, also in the context of translating Teradata SQL to other RDBMS: https://github.com/jOOQ/jOOQ/issues/11820. I can’t promise this for the upcoming week, but we’re very keen on getting this to work for jOOQ 3.15. I hope this helps, Lukas From: 'Pedro Figueiredo' via jOOQ User Group <[email protected]> Sent: Dienstag, 25. Mai 2021 16:56 To: jOOQ User Group <[email protected]> Subject: Re: Portability snowflake to bigquery Thank you for fast assistance Lukas, I will show a example that it need to do. For example in snowflake : SELECT date_trunc('month',received_at)::date AS dt, name, count(distinct id) as events FROM tableA WHERE received_at >= '2018-09-01' GROUP BY 1,2 ORDER BY 1 Must convert to bigquery SELECT cast(date_trunc(received_at, month)as date) AS dt, name, count(distinct id) as events FROM tableA WHERE received_at >= '2018-09-01' GROUP BY 1,2 ORDER BY 1 is this already working on version 3.15, I would like to understand what is already working. And thanks again for your assistance, please if there is another channel to talk please let me know and I will explain what I need. On Tuesday, May 25, 2021 at 3:37:05 AM UTC-3 [email protected]<mailto:[email protected]> wrote: Hi Pedro, Thank you very much for your message and for your interest in our translation service. Both the Snowflake and BigQuery dialects are work in progress for the upcoming jOOQ 3.15 dialect, with BigQuery being almost ready, while Snowflake still requires quite a bit of work. The library's upcoming 3.15 version (available already to paying customers) has one key feature that will definitely improve the experience of the translation use-case: An SPI that allows you to hook into the parser and translate table, column, and predicate expressions that may not yet be supported out of the box: https://www.jooq.org/doc/dev/manual/sql-building/sql-parser/sql-parser-listener/ However, from our experience, 50% of the times when users find limitations in the parser, they are very easy for us to fix really quickly, so if you find any issues, just let us know either here or through the issue tracker: https://github.com/jOOQ/jOOQ/issues/new/choose Please let me know if I can be of any further assistance and I'll be very happy to help, Lukas From: 'Pedro Figueiredo' via jOOQ User Group <[email protected]> Sent: Dienstag, 25. Mai 2021 05:32 To: jOOQ User Group <[email protected]> Subject: Portability snowflake to bigquery Hello, I'm new here. I was searching for a portability solution than rewrite queries from snowflake to bigquery and I found JOOQ, looks like amazing. I try used https://www.jooq.org/translate/, works not perfectly, I would like to know if the payed version is better. Can you help me with this answer or I don't if this translate it's open to try modify the way I need. Thanks a lot, and your solution its pretty nice. -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/557a4fc5-2fb3-4adf-baa8-6b73c8d0bb06n%40googlegroups.com<https://groups.google.com/d/msgid/jooq-user/557a4fc5-2fb3-4adf-baa8-6b73c8d0bb06n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/821fa0b2-aaa3-4a0c-a0eb-321bcb648370n%40googlegroups.com<https://groups.google.com/d/msgid/jooq-user/821fa0b2-aaa3-4a0c-a0eb-321bcb648370n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/AM7PR03MB6610D787F9F715A1DD794A0C9F259%40AM7PR03MB6610.eurprd03.prod.outlook.com.
