[
https://issues.apache.org/jira/browse/CALCITE-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17358773#comment-17358773
]
Julian Hyde commented on CALCITE-4640:
--------------------------------------
* In your example above, is "VIEW" the name of the view, or a keyword?
* Did you consider using table functions? A parameterized view is more like a
table function than a table. It's difficult to figure out, because SAP's
documentation doesn't give any clue how these parameters might be used in the
real world.
* Still, the work to make JdbcTableScan hintable is nice. I'll let [~danny0405]
sweat the details of that.
* In RelToSqlConverter, can you change how you cut the code up into methods. We
don't usually use Stream as a parameter to methods. Also, make {{node}} final,
and assign it exactly once.
* In AnsiSqlDialect, need space after '.'
* In SqlDialect, need '.' at end of sentence
* I think the use of a new {{SqlDialectFactory}} for testing is overkill. It
also leads to your test dialect having awkward (non-reentrant?) state &
lifecycle. Note that {{RelToSqlConverterTest.testUnparseSelectMustUseDialect}}
creates a dialect for just the duration of a test, without using a factory.
(Maybe an indication that your test should be in {{RelToSqlConverterTest}}
rather than {{JdbcAdaptertest}}?) If you use a similar approach, the hint
consumer can be a final variable in your test method.
* Please keep FOODMART_SCHEMA as is. After your change, it is not consistent
with SCOTT_SCHEMA.
> Propagate table scan hints to JDBC
> ----------------------------------
>
> Key: CALCITE-4640
> URL: https://issues.apache.org/jira/browse/CALCITE-4640
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.27.0
> Reporter: Ulrich Kramer
> Priority: Major
> Fix For: next
>
>
> We would like to use table scan hints to pass [parameters and variables to
> HANA
> views|https://help.sap.com/viewer/88fe5f56472e40cca6ef3c3dcab4855b/2.0.04/en-US/fafb3ea432e54fca9eff11648df5bccd.html].
> It should be possible to convert the following Calcite SQL
> {code}
> SELECT * FROM VIEW /*+ PLACEHOLDERS("$$PARAMETER_1$$"='Test') */
> {code}
> using a special {{SqlDialect}} to a HANA specific statement
> {code}
> SELECT * FROM VIEW ('PLACEHOLDER' = ('$$PARAMETER_1$$', 'Test'))
> {code}
> See also my [mail in the mailing
> list|https://mail-archives.apache.org/mod_mbox/calcite-dev/202105.mbox/%3CD161B82F-5DEC-49A2-A873-4817F4DEB15F%40contoso.com%3E].
--
This message was sent by Atlassian Jira
(v8.3.4#803005)