Closed franklinWhaite closed 2 months ago
Hi,
This is due to a bug in GoogleSQL. See bug report. There is a simple workaround using custom calculated fields in .yaml. When a yaml file is generated for the provided test case, it has the following lines:
field_alias: cast__date_field
ibis_expr: ibis.expr.types.TemporalValue.strftime
params:
- format_str: '%Y-%m-%d'
replace them with
field_alias: cast__date_field
ibis_expr: ibis.expr.types.TemporalValue.cast
params:
- target_type: str
Then everything works correctly.
Hi,
DVT uses the BQ
FORMAT_DATE
function (see table below) to convert the date to a string. When presented with a date before 1000 CE, this function does not print a two digit century number (a bug). There is a simplerCAST
option that can be used to cast dates to string which works correctly. The sequence of single and double quotes below is due to bash escape sequences - to embed one single quote within a quoted string.col_date
)col_date
AS string)