You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(spanner/spansql): support EXTRACT
* added separate Expr for Extract func and added unit and integration tests
* add test for year
* repleace atTimeZone func with atTimeZone expression
* fixing failing tests
* added negative test, reduced the valid extract part values.
* remove extra space
Co-authored-by: Rahul Yadav <irahul@google.com>
t.Errorf("error code mismatch for invalid part from EXTRACT\n Got: %v\nWant: %v", g, w)
755
+
}
756
+
rows.Stop()
757
+
751
758
// Do some complex queries.
752
759
tests:= []struct {
753
760
qstring
754
761
paramsmap[string]interface{}
755
762
want [][]interface{}
756
763
}{
757
764
{
758
-
`SELECT 17, "sweet", TRUE AND FALSE, NULL, B"hello", STARTS_WITH('Foo', 'B'), STARTS_WITH('Bar', 'B'), CAST(17 AS STRING), SAFE_CAST(TRUE AS STRING), SAFE_CAST('Foo' AS INT64)`,
765
+
766
+
`SELECT 17, "sweet", TRUE AND FALSE, NULL, B"hello", STARTS_WITH('Foo', 'B'), STARTS_WITH('Bar', 'B'), CAST(17 AS STRING), SAFE_CAST(TRUE AS STRING), SAFE_CAST('Foo' AS INT64), EXTRACT(DATE FROM TIMESTAMP('2008-12-25T05:30:00Z') AT TIME ZONE 'Europe/Amsterdam'), EXTRACT(YEAR FROM TIMESTAMP('2008-12-25T05:30:00Z'))`,
0 commit comments