-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
SQL row value comparison syntax #26936
Conversation
Current progress regarding things I had to do but I'm not 100% sure about:
|
Let me discuss this with @smitpatel to see exactly how we want to do this. I recommend holding off on this PR for a couple days until we're agreed on this.
I don't think there's much value in having RowValueExpandedTranslator extend RowValueTranslator - aside from looking up the relevant methods on EF.Functions, these translators shouldn't have anything in common really. We could also consider having RowValueExpandedTranslator in relational for any other provider where RowValueExpression isn't supported. (BTW naming-wise I'd call the translator RowValueComparisonTranslator)
Does it help if you add a [NotParameterized] attribute on the array parameters? Again, I'll confirm this one with @smitpatel as well. Re SearchConditionConvertingExpressionVisitor, this is a SQL Server-only visitor, but there's never going to be a RowValueExpression in SQL Server since that's not supported there. So I don't think that visitor needs to be changed. |
👍🏻
So it's ok to duplicate the shared code between them? That's looking up the EF.Functions, plus some other shared code like matching the method, unwrapping the arguments, etc. They're actually exactly the same except for the SqlExpressionFactory call. I wouldn't want to duplicate the match on method especially. I tried to find a translator with a similar scenario to check what you do but couldn't find any.
That did it! It's giving me the same
Alright, so I can just have it throw a |
@roji I have an initial working implementation for both row value and expanded comparisons. It wasn't a lot of work after resolving the parameter issue, I implemented some of your feedback too. As you said, I'll wait for your response regarding the array thing before going any further. |
@mrahhal we've discussed this internally, and unfortunately this raises some design questions which are more fundamental than initially thought. We're going to hold off on this for now since there's more highly-prioritized work that has to happen first - we'll revisit this in a few months based on where we are with the 7.0 release. I still fully hope we can get this in for 7.0 - it's just that we need to focus on other areas first. |
@roji Understood. I'll be ready to get this ready again in the future if necessary. |
Thanks for understand @mrahhal! |
@mrahhal I'm going to go ahead and close this for now, as discussed. We'll pick it up again when the proper tuple syntax becomes available. |
LessThan
,LessThanOrEqual
,GreaterThan
,GreatThanOrEqual
.RowValueExpression
that translates to SQL row value syntax.RowValueExpression
RowValueTranslator
QuerySqlGenerator
SqlExpressionFactory
SqlNullabilityProcessor
SearchConditionConvertingExpressionVisitor
RowValueComparisonTranslator
Closes #26822.