How to do Left Joins when compiling to PostgreSQL? #313
-
I saw the previous discussions (#71 and #186) on left joins, and the example in the tutorial (examples/scripts/outer_join.l). However when I follow those instructions, I'm getting an error when the compiled SQL tries to run on PostgreSQL: "HINT: No function matches the given name and argument types. You might need to add explicit type casts." The goal is to left join one column(d) based on 3 keys (a, b, c). I've tried writing it a couple ways, all resulting in the same error:
I also tried replacing AnyValue with String, just in case, but got the same error. I'm unsure if this is a bug, if I'm writing the query wrong, or if there is an alternative way to write left joins that gets around this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Thanks for reporting this. I've fixed it in the main branch. Your code should work now if you are running main branch. But it was not released to pip yet. To make it work right away you can define a custom function for taking any value.
But
CoLab: Please let me know if you have any further questions, or encouner any issues. |
Beta Was this translation helpful? Give feedback.
-
@EvgSkv just curious -- why here did you choose to implement AnyValue for Posgres like this: |
Beta Was this translation helpful? Give feedback.
Thanks for reporting this. I've fixed it in the main branch. Your code should work now if you are running main branch.
But it was not released to pip yet. To make it work right away you can define a custom function for taking any value.
Simplest is just to use
Min
:But
Min
won't work if the taken value is a struct or a list. For that useArgMin
with a constant value.CoLab:
https://colab.research.google.com/drive/1afE6Kayh9vhS…