Skip to content
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

Support "yyyy-MM-dd HH:mm:ss" cast Date type #20155

Closed
wants to merge 105 commits into from
Closed

Conversation

everypp
Copy link
Contributor

@everypp everypp commented Dec 18, 2023

Description

Supprt "yyyy-MM-dd HH:mm:ss" cast Date type
image

Additional context and related issues

#20153

Release notes

master

Copy link

cla-bot bot commented Dec 18, 2023

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@martint
Copy link
Member

martint commented Dec 18, 2023

Per the SQL specification, this is an invalid conversion. The string has to be equivalent to a valid date literal (i.e., YYYY-MM-DD), or a <cast template> that only contains specifiers for year, month and day need to be provided:

6.13 <cast specification>

image

9.52 Datetime templates

image

@mosabua mosabua changed the title Supprt "yyyy-MM-dd HH:mm:ss" cast Date type Support "yyyy-MM-dd HH:mm:ss" cast Date type Dec 19, 2023
Copy link

cla-bot bot commented Dec 20, 2023

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Dec 21, 2023

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Jan 2, 2024

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@cla-bot cla-bot bot added the cla-signed label Jan 9, 2024
findepi and others added 18 commits January 30, 2024 16:53
Engine-provided functions do not need
`ClassLoaderSafeConnectorTableFunction` wrapper.
Engine-provided functions do not need
`ClassLoaderSafeConnectorTableFunction` wrapper.
When `ConstantExpression` was created with a Trino type and a value
that didn't match this type's java type (for example Trino INTEGER with
value being Integer, instead of Long), the `ConstantExpression` would
fail to serialize to JSON. Such failure happens during sending task
status updates to workers and is currently logged and ignored, leading
to query hang. The problem could be triggered with SQL routines, which
utilize `RowExpression` (including `ConstantExpression`) serialization.

Thus, this fixes execution of SQL routines involving Row field
dereference.
The test must run single-threaded and was run like that until
9a7cf10.
Query start may be time consuming operation and should be traced.
Especially in case of `DataDefinitionExecution`, the start may cover all
of the query execution.
Tests extending `AbstractTestQueryFramework` inherit `PER_CLASS`
lifecycle and `CONCURRENT` behavior and that should be expected given
how `AbstractTestQueryFramework` works. No need to define that in
subclasses, and indeed most subclasses do not define these behaviors
again.
We observed duplicate attempts to drop spoolingOutputStats in some logs.  These warnings will help diagnose what's going on.
Some tests being fixed simply fail because they do not support
concurrent test method execution.
Others worked, but could allocate lots of resources, potentially leading
to OOM failures on CI.

The tests where found by looking at
9a7cf10 commit:

    git show 9a7cf10 | grep -A 3 '@test(singleThreaded = true)'
`TestQueryManager` defined a default `queryRunner` used by one test
method, but other test methods created additional runners. This commit
moves the default one into the only test method that used it. In the
result, there is at most 1 query runner at the same time created during
test execution.
Sometimes, `ConnectorSplitManager.getSplits` can take long to construct
`ConnectorSplitSource`. For example, in Delta, there is IO work being
done before `ConnectorSplitSource` is returned. This work would better
be delayed until `ConnectorSplitSource.getNextBatch` is invoked, but
currently this is not the case. Let's add tracing so that time spent in
`ConnectorSplitManager.getSplits` is attributable.
The parameter refers to "a stage span", not to the top level "query
span".
Failure injection is a for-tests functionality. Hide its config, they
are not meant to be used.
wendigo and others added 29 commits January 30, 2024 16:53
Added a dummy test in trino-server
- Currently uses default 30 and thats too low
- Also update to latest version of the action
- Also configure to only process PRs
HIVE/AVRO: It is possible for data that is written using a 3 element
union to be read with a 2 element union provided that either all
data types can be coerced (already possible) or the offending data
type(s) isn't present. This change delays all type errors to read time
to allow more type leniency.
With TestNG, `ManageTestResources` was attempting to prevent resource
leaks, including container leaks, in tests. It relied on certain common
test patterns to operate (like storing resource on instance fields).

This commit attempts to provide similar functionality for JUnit. For now
it's limited to containers. As an added bonus, it works regardless of
how the test class is written.
@everypp everypp closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.