Class Extern
Wrapper around a per-row computation that is fabric-specific.
Implements
Inherited Members
Namespace: Mangrove.MetricSetSyntaxTree.ExpressionNodes
Assembly: MetricSetSyntaxTree.dll
Syntax
public class Extern : Expression<Extern, Table>, IVisitable<IExpressionVisitor>, ICloneable<Extern, Table, Expression>, ICloneable<Expression>, IDirectedAcyclicGraph<Expression>
Remarks
The mangrove Expression classes are not flexible enough to capture all possible row-level computations in all possible compute fabrics. For example, how to capture C#'s LINQ expressions for Scope, or all possible Scala one-liners for Spark? The Extern class allows Mangrove to capture "black box" computations which do not make sense as standard expression trees.
Constructors
View SourceExtern(Table, ExternKind, TypeKind, IReadOnlyList<TokenOrExpression>, IReadOnlyList<String>, IReadOnlyList<String>)
Standard constructor, following Roslyn.
Declaration
[JsonConstructor]
public Extern(Table table, ExternKind externKind, TypeKind type, IReadOnlyList<TokenOrExpression> tokensAndDependencies, IReadOnlyList<string> resources = null, IReadOnlyList<string> imports = null)
Parameters
Type | Name | Description |
---|---|---|
Table | table | Table this expression should live in. |
ExternKind | externKind | Compute fabric this extern makes sense in. |
TypeKind | type | Type of the output of this extern. |
IReadOnlyList<TokenOrExpression> | tokensAndDependencies | List of components making up the expression, can be a mixture of string tokens, and expressions. |
IReadOnlyList<String> | resources | Language-specific files (e.g. DLL or JAR) this extern depends on. |
IReadOnlyList<String> | imports | Namespace imports this extern needs. |
Properties
View SourceDependencies
Hard-coded ordered list of expressions that this one depends on. For example,
the extern f_bar(a, b)
would have dependencies with names "a" and "b".
In some contexts, this needs to be a list only of ColumnReferences, such as
if this extern corresponds to a scope enricher or spark jar.
Declaration
[JsonIgnore]
public IReadOnlyList<Expression> Dependencies { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Expression> |
ExternKind
Computation fabric this extern is specific to.
Declaration
public ExternKind ExternKind { get; }
Property Value
Type | Description |
---|---|
ExternKind |
Imports
Namespaces (whether C# or Java / Scala) imported by this extern.
Declaration
public IReadOnlyList<string> Imports { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<String> |
Parents
Declaration
[JsonIgnore]
public override IReadOnlyList<Expression> Parents { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Expression> |
Overrides
View SourceResources
The names of resources (DLLs, NuGet packages, or JAR files) this extern needs.
Declaration
public IReadOnlyList<string> Resources { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<String> |
Tokens
Raw string snippets to interleave with the names of Dependencies. For
example, the extern f_bar(a, b)
would have tokens "f_bar(", ", ", and ")".
Declaration
[JsonIgnore]
public IReadOnlyList<string> Tokens { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<String> |
TokensAndDependencies
List of either Expression dependencies or string
snippets.
Declaration
public IReadOnlyList<TokenOrExpression> TokensAndDependencies { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<TokenOrExpression> |
Type
Declaration
public TypeKind Type { get; }
Property Value
Type | Description |
---|---|
TypeKind |
Methods
View SourceAccept(IExpressionVisitor)
Declaration
public override void Accept(IExpressionVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
IExpressionVisitor | visitor |
Overrides
View SourceClone(Table, IReadOnlyList<Expression>)
Declaration
public override Extern Clone(Table table, IReadOnlyList<Expression> parents)
Parameters
Type | Name | Description |
---|---|---|
Table | table | |
IReadOnlyList<Expression> | parents |
Returns
Type | Description |
---|---|
Extern |
Overrides
Clone(Table, Nullable<ExternKind>, Nullable<TypeKind>, IReadOnlyList<TokenOrExpression>, IReadOnlyList<String>, IReadOnlyList<String>)
Declaration
public Extern Clone(Table table = null, ExternKind? externKind = default(ExternKind? ), TypeKind? type = default(TypeKind? ), IReadOnlyList<TokenOrExpression> tokensAndDependencies = null, IReadOnlyList<string> resources = null, IReadOnlyList<string> imports = null)
Parameters
Type | Name | Description |
---|---|---|
Table | table | |
Nullable<ExternKind> | externKind | |
Nullable<TypeKind> | type | |
IReadOnlyList<TokenOrExpression> | tokensAndDependencies | |
IReadOnlyList<String> | resources | |
IReadOnlyList<String> | imports |
Returns
Type | Description |
---|---|
Extern |
ToString()
Interleave Tokens and names of Dependencies to create a valid computation in the underlying compute fabric. For example, if dependencies have names "a" and "b", and the tokens are "f_bar(", ",", and ")", this would return "f_bar(a,b)".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |