SPACE(n)now emitsSPACE(n)instead ofREPEAT(' ', n)VAR_POP(x)now emitsVAR_POP(x)instead ofVARIANCE_POP(x)VAR_SAMP(x)/VARIANCE(x)now emitsVAR_SAMP(x)instead ofVARIANCE(x)INSTR(s, sub)now emitsINSTR(s, sub)instead ofLOCATE(sub, s)SUBSTR(s, pos, len)now emitsSUBSTRinstead ofSUBSTRING
SUBSTRas explicit MaxCompute parser alias forexp.Substring
- Dialect split:
maxcompute.pynow delegates toparser.pyandgenerator.py(mirrors sqlglot's own mypyc-compile refactor)
- Regression coverage for ~20 functions previously relying on untested Hive inheritance: INITCAP, REVERSE, REPEAT, LPAD/RPAD, LTRIM/RTRIM, REGEXP_REPLACE, REGEXP_EXTRACT_ALL, INSTR, FIND_IN_SET, SUBSTR, SUBSTRING_INDEX, CONCAT_WS, FORMAT_NUMBER, COLLECT_LIST/SET, VAR_SAMP, VAR_POP, PERCENTILE, STDDEV, GREATEST/LEAST, CBRT, FACTORIAL, GET_JSON_OBJECT, JSON_TUPLE
Generator (MaxCompute SQL output)
DATEADD/DATEADDwith negated delta forDateSub(e.g. BigQueryDATE_SUB→DATEADD(dt, -3, 'DAY'))DATEDIFFwith optional unit argumentDATETRUNC/TRUNC_TIMEwith full week-unit support ('week'→'week(monday)')DATEPARTvia namedextract_sqlmethodGETDATE()forCurrentTimestamp,NOW()forCurrentDatetimeTOLOWER/TOUPPERforLower/UpperFROM_JSONforParseJSON,GET_USER_ID()forCurrentUser,TO_MILLISforUnixMillisAPPROX_DISTINCT,ARG_MAX,ARG_MINWM_CONCAT(sep, col)via namedgroupconcat_sqlmethod (with default separator guard)TO_CHARvia namedtochar_sqlmethod- Type mapping:
VARCHAR/CHAR/TEXT→STRING;DATETIMEpreserved
Parser (read direction)
- Statistical aggregates:
STDDEV_SAMP,COVAR_POP,COVAR_SAMP,CORR,MEDIAN,PERCENTILE_APPROX,BITWISE_AND_AGG,BITWISE_OR_AGG,BITWISE_XOR_AGG MAX_BY/MIN_BYas aliases forARG_MAX/ARG_MIN
TO_DATEformat string preserved as-is (Hive was converting Oracle-stylemm→%M)WEEKDAYround-trips asWEEKDAY(dt)in MaxCompute output (other dialects still get the(DAYOFWEEK + 5) % 7arithmetic)DATETRUNCweek-unit emits valid'week(monday)'string literal instead of bareWEEK(MONDAY)groupconcat_sqldefaults separator to','when absent (prevents invalidWM_CONCAT(col))- Python >=3.9 compatibility (removed
ipykernel, relaxedpytestfloor) - Added
sqlglot<31upper bound to prevent unexpected breakage on major releases
- GitHub Actions CI across Python 3.9 / 3.10 / 3.11 / 3.12
- README with usage examples and function coverage table
Initial release.
- MaxCompute dialect registered via Python entry points
- Parser: ~40 date/time, string, array, and map functions
- DDL:
LIFECYCLE,RANGE CLUSTERED BY,AUTO PARTITIONED BY