Has anyone implemented a presentation feature in the Apache Calcite adapter?
P粉885035114
P粉885035114 2023-09-02 12:15:50
0
1
390

I want to implement a show foo command related to the database engine we wish to connect to Calcite via the Calcite adapter. Of course, foo is something specific to that database engine. I'm trying to figure out which relnode it should be mapped to (among other details). So if anyone has implemented the "show" statement as a Calcite adapter and has some tips for me, it would be greatly appreciated.

My current idea is to create a new "foo" table type with the relevant columns that the command should return, and then map show foo to the equivalent:

;
select * from foo; 

Of course, this is done using Calcite relnodes. On the backend, I know what I have to convert it to.

P粉885035114
P粉885035114

reply all (1)
P粉668113768

You may want to check outsqlline, which implements commands similar toshow:!dbinfo,!tables,!schemasetc. If you look atCommands.javayou will see that they are implemented via JDBC.

From there, however, you can get to know the Calcite side of things in the various classes in theorg.apache.calcite.jdbcnamespace.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!