{"record":{"id":"e65d00ee760f492f","repo":"prestodb/presto","slug":"not-supported-e65d00","errorCode":"NOT_SUPPORTED","errorMessage":"non-default precision not yet supported","messagePattern":"non-default precision not yet supported","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java","lineNumber":459,"sourceCode":"                // Note this is deliberately not getCanonicalValue(), which upper cases instead.\n                Identifier identifier = name.get();\n                String fieldName = identifier.isDelimited() ? identifier.getValue() : identifier.getValueLowerCase();\n                // Duplicates are rejected because a row type with repeated field names cannot be\n                // round-tripped through its TypeSignature, which the native worker relies on.\n                if (!declaredNames.add(fieldName)) {\n                    throw new SemanticException(DUPLICATE_COLUMN_NAME, node, \"Duplicate field name '%s' in ROW\", fieldName);\n                }\n                fields.add(RowType.field(fieldName, fieldType, identifier.isDelimited()));\n            }\n\n            return setExpressionType(node, RowType.from(fields.build()));\n        }\n\n        @Override\n        protected Type visitCurrentTime(CurrentTime node, StackableAstVisitorContext<Context> context)\n        {\n            if (node.getPrecision() != null) {\n                throw new SemanticException(NOT_SUPPORTED, node, \"non-default precision not yet supported\");\n            }\n\n            Type type;\n            switch (node.getFunction()) {\n                case DATE:\n                    type = DATE;\n                    break;\n                case TIME:\n                    type = TIME_WITH_TIME_ZONE;\n                    break;\n                case LOCALTIME:\n                    type = TIME;\n                    break;\n                case TIMESTAMP:\n                    type = TIMESTAMP_WITH_TIME_ZONE;\n                    break;\n                case LOCALTIMESTAMP:\n                    type = TIMESTAMP;","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java#L441-L477","documentation":"CURRENT_TIME-family functions (current_date, current_time, etc.) accept an optional precision parameter, but the analyzer only supports the default precision. Any explicit non-null precision triggers this NOT_SUPPORTED SemanticException.","triggerScenarios":"Calling current_time(3), current_timestamp(6), or any CurrentTime expression with getPrecision() != null.","commonSituations":"Migrating SQL from MySQL/Postgres where current_timestamp(6) is common, ORM-generated SQL that adds precision arguments, hand-porting vendor-specific datetime syntax.","solutions":["Remove the precision argument and use the function without parameters","Round/truncate to the desired precision with a separate function like date_trunc or a cast to timestamp(6)","Rewrite the query to avoid non-default precision"],"exampleFix":"// before\nSELECT current_timestamp(6)\n// after\nSELECT CAST(current_timestamp AS TIMESTAMP(6))","handlingStrategy":"validation","validationCode":"// reject precision args before sending SQL\nPattern p = Pattern.compile(\"(?i)current_(time(stamp)?|date)\\\\s*\\\\(\");\nif (p.matcher(sql).find()) throw new IllegalArgumentException(\"CURRENT_TIME precision not supported\");","typeGuard":null,"tryCatchPattern":"try {\n    return execute(sql);\n} catch (SemanticException e) {\n    if (e.getCode() == NOT_SUPPORTED) {\n        sql = stripCurrentTimePrecision(sql); // rewrite and retry once\n        return execute(sql);\n    } throw e;\n}","preventionTips":["Never pass precision arguments to current_date/current_time/current_timestamp in Presto","Use CAST to timestamp(n) when a specific precision is needed","Add a SQL lint rule flagging current_* functions with arguments","Document the limitation for teams migrating from MySQL/Postgres"],"tags":["sql","unsupported-feature","temporal"],"backgroundTag":"feature-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}