Package org.partiql.lang.ast.passes

Types

Link copied to clipboard
class SemanticException(message: String, errorCode: ErrorCode, errorContext: PropertyValueMap, cause: Throwable?) : SqlException

The exception to be thrown by semantic passes.

Link copied to clipboard
sealed class SemanticProblemDetails : ProblemDetails

Variants of SemanticProblemDetails contain info about various problems that can be encountered through semantic passes.

Link copied to clipboard
typealias UserDefinedFunctionRedactionLambda = (List<PartiqlAst.Expr>) -> List<PartiqlAst.Expr>

This is a function alias for determining which UDF input arguments need to be redacted.

There are two components needed for implementation: 1. Which arguments are needed for SafeFieldName validation 2. Which arguments are needed for redaction should be returned

For example, for a given function in which argument number is static, func(a, b, c, d), we can validate whether a and b are a SafeFieldName, if yes, c and d will be redacted.

Functions

Link copied to clipboard
fun redact(statement: String, providedSafeFieldNames: Set<String> = emptySet(), userDefinedFunctionRedactionConfig: Map<String, UserDefinedFunctionRedactionLambda> = emptyMap()): String

From the input PartiQL statement, returns a statement in which PartiqlAst.Expr.Lits not assigned with providedSafeFieldNames are redacted to "***(Redacted)".

fun redact(statement: String, partiqlAst: PartiqlAst.Statement, providedSafeFieldNames: Set<String> = emptySet(), userDefinedFunctionRedactionConfig: Map<String, UserDefinedFunctionRedactionLambda> = emptyMap()): String

From the input PartiQL statement, returns a statement in which PartiqlAst.Expr.Lits not assigned with providedSafeFieldNames are redacted to "***(Redacted)". Assumes that the parsed PartiQL statement is the same as the input ast.

Link copied to clipboard
fun skipRedaction(node: PartiqlAst.Expr, safeFieldNames: Set<String>): Boolean

Returns true if the given node type is to be skipped for redaction or its text is one of the safeFieldNames.

Properties

Link copied to clipboard
const val INPUT_AST_STATEMENT_MISMATCH: String
Link copied to clipboard
const val INVALID_NUM_ARGS: String