Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Attribute Type Checking for Sentiment, Aggregation, Hash Join Operators in Front-End #1924

Merged
merged 33 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7648873
Add type checking for Sentiment, Aggregation, Hash Join
aahei May 23, 2023
7733c59
Resolve some PR comments
aahei May 31, 2023
78a4474
Format fix
aahei May 31, 2023
a524e54
fix: initialized validators object in case undefined
aahei Jun 1, 2023
a2ab878
Merge branch 'master' into cli-attr-type-checking
Yicong-Huang Jun 3, 2023
f0acec5
some cleanup and added todos
Yicong-Huang Jun 3, 2023
b1b5809
Hardcode port and refactor code
aahei Jun 4, 2023
187583b
Friendly Error message
aahei Jun 4, 2023
715d89b
modify error message
aahei Jun 4, 2023
b5711f0
experimentally change alert box to blue
aahei Jun 4, 2023
91ce51c
more accurate css selector
aahei Jun 5, 2023
beb78d8
error message and color change
aahei Jun 5, 2023
faafa7f
Change name to attributeTypeRules
aahei Jun 5, 2023
d3664e1
Merge branch 'master' into cli-attr-type-checking
aahei Jun 5, 2023
f42acf3
format
aahei Jun 5, 2023
7cabba4
Merge branch 'master' into cli-attr-type-checking
aahei Jun 5, 2023
5ed9f9c
use autofillAttributeTypeOnPort for port
aahei Jun 8, 2023
b716840
Merge branch 'cli-attr-type-checking' of https://github.com/Texera/te…
aahei Jun 8, 2023
9688a05
Merge branch 'master' into cli-attr-type-checking
Yicong-Huang Jun 12, 2023
b388695
Merge branch 'master' into cli-attr-type-checking
Yicong-Huang Jun 12, 2023
7185265
fix format
Yicong-Huang Jun 12, 2023
7109726
Merge branch 'master' into cli-attr-type-checking
Yicong-Huang Jun 14, 2023
37376f2
refactor
Yicong-Huang Jun 14, 2023
22808db
fix format
Yicong-Huang Jun 14, 2023
5ea2e08
simplify
Yicong-Huang Jun 14, 2023
35cc4c1
fix change after detection error
Yicong-Huang Jun 15, 2023
430cb37
fix format
Yicong-Huang Jun 15, 2023
9c03be8
Disabled a unit test in operator-property-edit-frame
aahei Jun 16, 2023
7567236
Always show form validation error
aahei Jun 16, 2023
4e99627
skip type validation when data attribute not selected
aahei Jun 16, 2023
6a5c466
Move type check back into jsonSchemaMapIntercept.
aahei Jun 16, 2023
c0d933e
format
aahei Jun 16, 2023
97fe6b6
Merge branch 'master' into cli-attr-type-checking
Yicong-Huang Jun 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package edu.uci.ics.texera.workflow.operators.aggregate

import com.fasterxml.jackson.annotation.{JsonIgnore, JsonProperty, JsonPropertyDescription}
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
import com.kjetland.jackson.jsonSchema.annotations.{JsonSchemaInject, JsonSchemaTitle}
import edu.uci.ics.texera.workflow.common.metadata.annotations.AutofillAttributeName
import edu.uci.ics.texera.workflow.common.operators.aggregate.DistributedAggregation
import edu.uci.ics.texera.workflow.common.tuple.Tuple
Expand All @@ -10,8 +10,38 @@ import edu.uci.ics.texera.workflow.common.tuple.schema.{Attribute, AttributeType

import java.sql.Timestamp

@JsonSchemaInject(json =
"""
{
"attributeType": {
"0:attribute": {
"allOf": [
{
"if": {
"aggFunction": {
"valEnum": ["sum", "average", "min", "max"]
}
},
"then": {
"enum": ["integer", "long", "double"]
}
},
{
"if": {
"aggFunction": {
"valEnum": ["concat"]
}
},
"then": {
"enum": ["string"]
}
}
]
}
}
}
""")
class AggregationOperation() {

@JsonProperty(required = true)
@JsonSchemaTitle("Aggregation Function")
@JsonPropertyDescription("sum, count, average, min, max, or concat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@ package edu.uci.ics.texera.workflow.operators.hashJoin

import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
import com.google.common.base.Preconditions
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
import com.kjetland.jackson.jsonSchema.annotations.{JsonSchemaInject, JsonSchemaTitle}
import edu.uci.ics.amber.engine.architecture.deploysemantics.layer.OpExecConfig
import edu.uci.ics.texera.workflow.common.metadata.annotations.{
AutofillAttributeName,
AutofillAttributeNameOnPort1
}
import edu.uci.ics.texera.workflow.common.metadata.{
InputPort,
OperatorGroupConstants,
OperatorInfo,
OutputPort
}
import edu.uci.ics.texera.workflow.common.metadata.annotations.{AutofillAttributeName, AutofillAttributeNameOnPort1}
import edu.uci.ics.texera.workflow.common.metadata.{InputPort, OperatorGroupConstants, OperatorInfo, OutputPort}
import edu.uci.ics.texera.workflow.common.operators.OperatorDescriptor
import edu.uci.ics.texera.workflow.common.tuple.schema.{Attribute, OperatorSchemaInfo, Schema}
import edu.uci.ics.texera.workflow.common.workflow.{HashPartition, PartitionInfo}

import scala.collection.convert.ImplicitConversions.`collection AsScalaIterable`

@JsonSchemaInject(json =
"""
{
"attributeType": {
"0:buildAttributeName": {
"const": {
"$data": "1:probeAttributeName"
}
}
}
}
"""
)
class HashJoinOpDesc[K] extends OperatorDescriptor {

@JsonProperty(required = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package edu.uci.ics.texera.workflow.operators.sentiment

import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
import com.fasterxml.jackson.annotation.{JacksonAnnotationsInside, JsonProperty, JsonPropertyDescription}
import com.google.common.base.Preconditions
import com.kjetland.jackson.jsonSchema.annotations.{JsonSchemaInject, JsonSchemaString}
import edu.uci.ics.amber.engine.architecture.deploysemantics.layer.OpExecConfig
import edu.uci.ics.amber.engine.common.Constants
import edu.uci.ics.texera.workflow.common.metadata.{
InputPort,
OperatorGroupConstants,
OperatorInfo,
OutputPort
}
import edu.uci.ics.texera.workflow.common.metadata.{InputPort, OperatorGroupConstants, OperatorInfo, OutputPort}
import edu.uci.ics.texera.workflow.common.metadata.annotations.AutofillAttributeName
import edu.uci.ics.texera.workflow.common.operators.map.MapOpDesc
import edu.uci.ics.texera.workflow.common.tuple.schema.{AttributeType, OperatorSchemaInfo, Schema}
Expand All @@ -18,6 +14,17 @@ import java.util.Collections
import java.util.Collections.singletonList
import scala.collection.JavaConverters.{asScalaBuffer, mapAsScalaMap}

@JsonSchemaInject(json =
"""
{
"attributeType": {
"0:attribute": {
"enum": ["string"]
}
}
}
"""
)
class SentimentAnalysisOpDesc extends MapOpDesc {
@JsonProperty(value = "attribute", required = true)
@JsonPropertyDescription("column to perform sentiment analysis on")
Expand Down
7 changes: 5 additions & 2 deletions core/new-gui/src/app/common/formly/formly-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { FormlyFieldConfig } from "@ngx-formly/core";
import { isDefined } from "../util/predicate";
import { SchemaAttribute } from "../../workspace/service/dynamic-schema/schema-propagation/schema-propagation.service";
import {
PortInputSchema,
SchemaAttribute
} from "../../workspace/service/dynamic-schema/schema-propagation/schema-propagation.service";
import { Observable } from "rxjs";
import { FORM_DEBOUNCE_TIME_MS } from "../../workspace/service/execute-workflow/execute-workflow.service";
import { debounceTime, distinctUntilChanged, filter, share } from "rxjs/operators";
Expand Down Expand Up @@ -53,7 +56,7 @@ export function createShouldHideFieldFunc(
}

export function setChildTypeDependency(
attributes: ReadonlyArray<ReadonlyArray<SchemaAttribute> | null> | undefined,
attributes: ReadonlyArray<PortInputSchema | undefined> | undefined,
parentName: string,
fields: FormlyFieldConfig[],
childName: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@
font-size: 0.5em;
color: gray;
}

::ng-deep {
// overwrite the color of the error message box
.texera-workspace-property-editor-form {
[role="alert"] {
color: #0c5460;
background-color: #d1ecf1;
border-color: #bee5eb;
}
}
}
Loading