Record Class DefRelationStatement
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.DefRelationStatement
- Record Components:
exported-trueunless theprivatemodifier is presentname- the function name; must not be blankparameters- the typed parameter list; must not be nullbody- the relational-algebra expression body; must not be nulllocation- the source location of this statement; never null
- All Implemented Interfaces:
Statement
public record DefRelationStatement(boolean exported, String name, List<ParameterDefinition> parameters, RelNode body, SourceLocation location)
extends Record
implements Statement
A
def … : relation statement — defines a table-valued (relation-returning)
user-defined function.
Syntax:
def recentOrders(cid: NUMBER): RELATION := {
σ customer_id = cid ∧ status = "completed" (Orders)
};
private def activeUsers(): RELATION := { σ status = "active" (Users) };
The : RELATION return-type annotation distinguishes this from the
scalar DefStatement; the body is a fully-parsed relational-algebra
RelNode expression (delegated to the RA parser), not a scalar operand.
A DefRelationStatement corresponds directly to a
RelationFunctionSymbol — the
semantic layer creates the symbol and registers it in the symbol table.
-
Constructor Summary
ConstructorsConstructorDescriptionDefRelationStatement(boolean exported, String name, List<ParameterDefinition> parameters, RelNode body) Convenience constructor for tests; usesSourceLocation.UNKNOWN.DefRelationStatement(boolean exported, String name, List<ParameterDefinition> parameters, RelNode body, SourceLocation location) Creates an instance of aDefRelationStatementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexported()Returns the value of theexportedrecord component.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.name()Returns the value of thenamerecord component.static DefRelationStatementof(String name, List<ParameterDefinition> parameters, RelNode body) Creates an exported table-valued-function def statement (the common case).Returns the value of theparametersrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefRelationStatement
public DefRelationStatement(boolean exported, String name, List<ParameterDefinition> parameters, RelNode body, SourceLocation location) Creates an instance of aDefRelationStatementrecord class.- Parameters:
exported- the value for theexportedrecord componentname- the value for thenamerecord componentparameters- the value for theparametersrecord componentbody- the value for thebodyrecord componentlocation- the value for thelocationrecord component
-
DefRelationStatement
public DefRelationStatement(boolean exported, String name, List<ParameterDefinition> parameters, RelNode body) Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
of
public static DefRelationStatement of(String name, List<ParameterDefinition> parameters, RelNode body) Creates an exported table-valued-function def statement (the common case). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
exported
public boolean exported()Returns the value of theexportedrecord component.- Returns:
- the value of the
exportedrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
location
Returns the value of thelocationrecord component.
-