How to use Apache calcite LIKE_REGEX - regex

I would like to use LIKE_REGEX in Apache calcite SQL query and can not find any documentation or examples on how to use it. Can you please share examples or documentation around it's usage.

LIKE_REGEX was introduced in the SQL:2008 standard but as of version 1.17 Calcite does not currently support it. (If you look at Calcite's SQL reference, LIKE_REGEX appears in Calcite's list of reserved SQL keywords because Calcite automatically reserves keywords listed in the SQL standard.)
If you would like to match regular expressions, use SIMILAR TO. For example, the query VALUES 'abcccd' similar to 'ab*c+d' returns TRUE.
Calcite's implementation of SIMILAR TO has semantics similar to PostgreSQL's implementation.

Related

How to take advantage of calcite-server

Our project relies on calcite-core, but we also need to use DDL statements. The server module (calcite-server) adds DDL support to Calcite. How can we take advantage of calcite-server to support our demands?
calcite's documentations have mentioned that
If you are the author of a sub-project, it is unlikely that your syntax extensions match those in calcite-server, so we recommend that you add your SQL syntax extensions by extending the core parser; if you want DDL commands, you may be able to copy-paste from calcite-server into your project.
Does this mean that we should extend Calcite-core by ourselves instead of using Calcite-server directly.
Is there a better way?
If you are fine using the dialect of DDL supported by calcite-server, feel free. But if you have your own dialect of DDL, you'll likely need to write your own version of calcite-server.

Can XSD restriction be platform specific?

I have to specify a restriction for one of xml attribute, I know I can use the syntax below.
But the minInclusive and MaxInclusive depends on platform. How do I specify such syntax? Are they supported in XSD?
Thanks,
Ram
Saxon's XSD processor introduces the idea of validation parameters, which you can specify when invoking the schema processor from the command line or from an application - you can't use them in facets like minInclusive and maxInclusive, but you can use them in xs:assert and other places where XPath expressions are used.
It's good to see that this meets a real requirement, though to be honest, until such a feature becomes widely implemented in other processors it would be a little unwise to base your strategy on it.

Does Teradata 14 support bitwise?

I can swear that I heard that TD14 will support bitwise, but I see no mention of it in searches nor searching "bitwise" in the TD14 manual.
Can someone confirm whether or not bitwise is supported?
BTW, the manual I am looking at is the Teradata User Documentation in case there's another doc that I should be reading.
Check out Chapter 4 of the Teradata 14 SQL Functions, Operators, Expressions and Predicates manual explains the Byte/Bit Manipulation Functions available in Teradata 14 via embedded services functions.
(read: They are not native ANSI operators like what is found in Transact-SQL.)
Yes, Teradata 14 (and other versions) support these kinds of functions, as documented in Chapter 6, "Bit/Byte Manipulation Functions," of the "SQL Functions, Operators, Expressions, and Predicates" reference. Specifically, they have BITAND(target_arg, bit_mask_arg), as well as BITNOT, BITOR, BITXOR, COUNTSET, GETBIT, SETBIT, ROTATELEFT, ROTATERIGHT, SHIFTLEFT, SHIFTRIGHT, and SUBBITSTR.

searching for a BNF (for yacc) grammar of C++

I found something similar here: Where can I find standard BNF or YACC grammar for C++ language?
But the download links don't work anymore, and I want to ask if somebody know where I can download it now?
C++ is not a context-free language and therefore cannot be accurately parsed using a parser like BNF or yacc. However, it is possible to parse a superset of the language with those tools, and then apply additional contextual processing to the parsed structure.
Looking here: http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-38.11, I found this: http://www.computing.surrey.ac.uk/research/dsrg/fog/CxxGrammar.y
Depending on your task, you might want to use an existing C++ frontend instead.
The EDG Compiler Frontend and the CLang Frontend have both been designed so as to be used independently from "pure compilation".
CLang notably features accurate location of tokens and for example includes "rewrite" tools that can be used to modify existing code.

C++ SQL Queries/SQL Wrapped for C++?

Just more a general question I can't seem to find a definite answer on.
But what is a good SQL wrapper for C++ that allows me to call queries?
I'm used to Oracle, but i've used MYSQL before aswell.
And how would you call something such as an insert statement (for example) in one?
Personally I love SOCI, simple and easy to use, just follow the link for easy example code and a much better explanation of what SOCI is all about then I could put in this answer. I use this for all of my C++ SQL development work.