Skip to content

[CALCITE-3552] Support MySQL ExtractValue function#1645

Merged
chunweilei merged 2 commits into
apache:masterfrom
ritesh-kapoor:CALCITE-3552-mysql-extractvalue
Dec 16, 2019
Merged

[CALCITE-3552] Support MySQL ExtractValue function#1645
chunweilei merged 2 commits into
apache:masterfrom
ritesh-kapoor:CALCITE-3552-mysql-extractvalue

Conversation

@ritesh-kapoor

Copy link
Copy Markdown
Contributor

No description provided.

* The <code>EXTRACTVALUE</code> function.
*/
public class SqlExtractValueFunction extends SqlFunction {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not that necessary, use SqlFunction directly is okey. We only need new class when we want to customize the operands/return type inference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

ReturnTypes.cascade(ReturnTypes.VARCHAR_2000, SqlTypeTransforms.FORCE_NULLABLE),
null, OperandTypes.STRING_STRING, SqlFunctionCategory.SYSTEM);


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oracle also has this function[1]. Is it the same?

[1] https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions052.htm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the docs, seems like there is difference in behaviour of MySql ExtractValue and Oracle ExtractValue.

@danny0405 danny0405 added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Dec 12, 2019
@chunweilei
chunweilei merged commit 607a0b6 into apache:master Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants