Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -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
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -37,15 +37,23 @@ 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)
@JsonSchemaTitle("Attribute Name")
@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"),
Expand All @@ -58,7 +66,11 @@ trait TextSourceOpDesc {
)
var fileScanLimit: Option[Int] = None

@JsonSchemaTitle("Offset")
@JsonSchemaTitle("Offset (lines)")
Comment thread
Yicong-Huang marked this conversation as resolved.
@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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
Loading