diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextInputSourceOpDesc.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextInputSourceOpDesc.scala index cfb14940f43..50de683f70a 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextInputSourceOpDesc.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextInputSourceOpDesc.scala @@ -19,7 +19,7 @@ package org.apache.texera.amber.operator.source.scan.text -import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription} import com.kjetland.jackson.jsonSchema.annotations.{JsonSchemaInject, JsonSchemaTitle} import org.apache.texera.amber.core.executor.OpExecWithClassName import org.apache.texera.amber.core.tuple.Schema @@ -34,6 +34,7 @@ class TextInputSourceOpDesc extends SourceOperatorDescriptor with TextSourceOpDe @JsonProperty(required = true) @JsonSchemaTitle("Text") @JsonSchemaInject(json = UIWidget.UIWidgetTextArea) + @JsonPropertyDescription("Enter the input text. By default, each line becomes one tuple.") var textInput: String = _ override def getPhysicalOp( diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextSourceOpDesc.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextSourceOpDesc.scala index afa4a3604c0..07a773580f6 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextSourceOpDesc.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/text/TextSourceOpDesc.scala @@ -19,7 +19,7 @@ package org.apache.texera.amber.operator.source.scan.text -import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription} import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.kjetland.jackson.jsonSchema.annotations.{ JsonSchemaInject, @@ -37,6 +37,10 @@ import org.apache.texera.amber.operator.source.scan.FileAttributeType trait TextSourceOpDesc { @JsonProperty(defaultValue = "string", required = true) @JsonSchemaTitle("Attribute Type") + @JsonPropertyDescription( + "The output field type. Each line becomes a separate tuple, except for " + + "'single string' / 'binary' / 'large binary', where the entire text becomes one tuple." + ) var attributeType: FileAttributeType = FileAttributeType.STRING @JsonProperty(defaultValue = "line", required = true) @@ -44,8 +48,12 @@ trait TextSourceOpDesc { @JsonDeserialize(contentAs = classOf[java.lang.String]) var attributeName: String = "line" - @JsonSchemaTitle("Limit") + @JsonSchemaTitle("Limit (lines)") @JsonDeserialize(contentAs = classOf[Int]) + @JsonPropertyDescription( + "Maximum number of lines to output. Leave empty to read all lines. " + + "(Ignored when reading the whole file as one tuple.)" + ) @JsonSchemaInject( strings = Array( new JsonSchemaString(path = HideAnnotation.hideTarget, value = "attributeType"), @@ -58,7 +66,11 @@ trait TextSourceOpDesc { ) var fileScanLimit: Option[Int] = None - @JsonSchemaTitle("Offset") + @JsonSchemaTitle("Offset (lines)") + @JsonPropertyDescription( + "Number of lines to skip from the start before reading. " + + "(Ignored when reading the whole file as one tuple.)" + ) @JsonDeserialize(contentAs = classOf[Int]) @JsonSchemaInject( strings = Array( diff --git a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.scss b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.scss index 0c652438848..740ac592043 100644 --- a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.scss +++ b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.scss @@ -60,6 +60,13 @@ nz-input-number { width: 100%; } + // preserve newlines (\n) in property descriptions rendered via nzExtra, + // and give them breathing room from the input above + .ant-form-item-extra { + white-space: pre-line; + margin-top: 6px; + line-height: 1.4; + } } }