{"record":{"id":"80c5c5e414a108ee","repo":"cube-js/cube","slug":"not-implemented-80c5c5","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/compile/engine/udf/common.rs","lineNumber":953,"sourceCode":"    let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Date32)));\n\n    ScalarUDF::new(\n        \"date\",\n        &Signature::uniform(\n            1,\n            vec![\n                DataType::Timestamp(TimeUnit::Nanosecond, None),\n                DataType::Utf8,\n            ],\n            Volatility::Immutable,\n        ),\n        &return_type,\n        &fun,\n    )\n}\n\npub fn create_makedate_udf() -> ScalarUDF {\n    let fun = make_scalar_function(move |_args: &[ArrayRef]| todo!(\"Not implemented\"));\n\n    let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Date32)));\n\n    ScalarUDF::new(\n        \"makedate\",\n        &Signature::exact(\n            vec![DataType::Int64, DataType::Int64],\n            Volatility::Immutable,\n        ),\n        &return_type,\n        &fun,\n    )\n}\n\npub fn create_year_udf() -> ScalarUDF {\n    let fun = make_scalar_function(move |_args: &[ArrayRef]| todo!(\"Not implemented\"));\n\n    let return_type: ReturnTypeFunction = Arc::new(move |_| Ok(Arc::new(DataType::Int64)));","sourceCodeStart":935,"sourceCodeEnd":971,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/compile/engine/udf/common.rs#L935-L971","documentation":"The MAKEDATE scalar UDF in CubeSQL is registered with a stub implementation: its body is todo!(\"Not implemented\"), which panics if the function is actually evaluated. Registration exists for planning/compatibility, but execution is unsupported.","triggerScenarios":"Running a SQL query that evaluates MAKEDATE(year, day) through CubeSQL's Postgres-compatible interface, forcing the UDF's compute path.","commonSituations":"Porting MySQL queries using MAKEDATE to Cube; BI tools generating MAKEDATE in date dimension SQL.","solutions":["Rewrite the query to construct dates without MAKEDATE, e.g. CAST(concat(year, '-01-01') AS DATE) + interval arithmetic or make_date equivalents supported by the engine","Push the computation into the underlying database instead of CubeSQL","Track/implement the UDF in rust/cubesql/cubesql/src/compile/engine/udf/common.rs"],"exampleFix":"-- before\nSELECT MAKEDATE(2024, 60);\n-- after\nSELECT DATE '2024-01-01' + INTERVAL '59 days';","handlingStrategy":"try-catch","validationCode":"// detect unsupported UDF before sending SQL\nconst UNSUPPORTED = /\\bMAKEDATE\\s*\\(/i;\nif (UNSUPPORTED.test(sql)) throw new Error('MAKEDATE is not implemented in CubeSQL; rewrite the query');","typeGuard":null,"tryCatchPattern":"try {\n  return await cube.sqlApi.query(sql);\n} catch (e) {\n  if (String(e).includes('Not implemented')) {\n    return await cube.sqlApi.query(rewriteWithoutMakedate(sql));\n  }\n  throw e;\n}","preventionTips":["Avoid MySQL-specific date functions (MAKEDATE) in CubeSQL queries","Use EXTRACT/DATE_PART or compute in data models","Check CubeSQL UDF support list before porting queries"],"tags":["cubesql","udf","not-implemented","sql"],"backgroundTag":"unimplemented-function","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}