diff --git a/common/config/src/main/resources/storage.conf b/common/config/src/main/resources/storage.conf index 85a62b77a3b..85002175893 100644 --- a/common/config/src/main/resources/storage.conf +++ b/common/config/src/main/resources/storage.conf @@ -34,10 +34,10 @@ storage { uri-without-scheme = "localhost:5432/texera_iceberg_catalog" uri-without-scheme = ${?STORAGE_ICEBERG_CATALOG_POSTGRES_URI_WITHOUT_SCHEME} - username = "texera" + username = "anish" username = ${?STORAGE_ICEBERG_CATALOG_POSTGRES_USERNAME} - password = "password" + password = "" password = ${?STORAGE_ICEBERG_CATALOG_POSTGRES_PASSWORD} } } @@ -131,10 +131,10 @@ storage { url-for-test-cases = "jdbc:postgresql://localhost:5432/texera_db_for_test_cases?currentSchema=texera_db,public" url-for-test-cases = ${?STORAGE_JDBC_URL_FOR_TEST_CASES} - username = "postgres" + username = "anish" username = ${?STORAGE_JDBC_USERNAME} - password = "postgres" + password = "" password = ${?STORAGE_JDBC_PASSWORD} } } diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala index eb319a82d1d..7f78f78e55f 100644 --- a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/LogicalOp.scala @@ -130,6 +130,7 @@ import org.apache.texera.amber.operator.visualization.scatter3DChart.Scatter3dCh import org.apache.texera.amber.operator.visualization.scatterplot.ScatterplotOpDesc import org.apache.texera.amber.operator.visualization.tablesChart.TablesPlotOpDesc import org.apache.texera.amber.operator.visualization.ternaryPlot.TernaryPlotOpDesc +import org.apache.texera.amber.operator.visualization.polarChart.PolarChartOpDesc import org.apache.texera.amber.operator.visualization.timeSeriesplot.TimeSeriesOpDesc import org.apache.texera.amber.operator.visualization.treeplot.TreePlotOpDesc import org.apache.texera.amber.operator.visualization.urlviz.UrlVizOpDesc @@ -186,6 +187,7 @@ trait StateTransferFunc new Type(value = classOf[LineChartOpDesc], name = "LineChart"), new Type(value = classOf[WaterfallChartOpDesc], name = "WaterfallChart"), new Type(value = classOf[BarChartOpDesc], name = "BarChart"), + new Type(value = classOf[PolarChartOpDesc], name = "PolarChart"), new Type(value = classOf[RangeSliderOpDesc], name = "RangeSlider"), new Type(value = classOf[PieChartOpDesc], name = "PieChart"), new Type(value = classOf[QuiverPlotOpDesc], name = "QuiverPlot"), diff --git a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/polarChart/PolarChartOpDesc.scala b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/polarChart/PolarChartOpDesc.scala new file mode 100644 index 00000000000..2c167cc26ef --- /dev/null +++ b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/polarChart/PolarChartOpDesc.scala @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + * OF ANY KIND, either express or implied. + */ + +package org.apache.texera.amber.operator.visualization.polarChart + +import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription} +import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle +import org.apache.texera.amber.core.tuple.{AttributeType, Schema} +import org.apache.texera.amber.core.workflow.OutputPort.OutputMode +import org.apache.texera.amber.core.workflow.{InputPort, OutputPort, PortIdentity} +import org.apache.texera.amber.operator.PythonOperatorDescriptor +import org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName +import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants, OperatorInfo} + +class PolarChartOpDesc extends PythonOperatorDescriptor { + + @JsonProperty(value = "r", required = true) + @JsonSchemaTitle("r") + @JsonPropertyDescription("The column name for radial values (must be numeric)") + @AutofillAttributeName + var r: String = "" + + @JsonProperty(value = "theta", required = true) + @JsonSchemaTitle("theta") + @JsonPropertyDescription("The column name for angular values (must be numeric)") + @AutofillAttributeName + var theta: String = "" + + override def getOutputSchemas( + inputSchemas: Map[PortIdentity, Schema] + ): Map[PortIdentity, Schema] = { + val outputSchema = Schema() + .add("html-content", AttributeType.STRING) + + Map(operatorInfo.outputPorts.head.id -> outputSchema) + } + + override def operatorInfo: OperatorInfo = + OperatorInfo( + "Polar Chart", + "Displays data points in a polar scatter plot", + OperatorGroupConstants.VISUALIZATION_SCIENTIFIC_GROUP, + inputPorts = List(InputPort()), + outputPorts = List(OutputPort(mode = OutputMode.SINGLE_SNAPSHOT)) + ) + + override def generatePythonCode(): String = { + s"""from pytexera import * + |import plotly.graph_objects as go + |import plotly.io as pio + |import numpy as np + | + |class ProcessTableOperator(UDFTableOperator): + | + | @overrides + | def process_table(self, table: Table, port: int) -> Iterator[Optional[TableLike]]: + | + | if table is None or table.empty: + | yield {'html-content': '