Skip to content

Commit

Permalink
Rename theta packages, too
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalkin committed Jan 29, 2025
1 parent c44364a commit 050710f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import org.apache.spark.sql.catalyst.analysis.FunctionRegistry.FunctionBuilder
import org.apache.spark.sql.catalyst.expressions.{ExpressionInfo}

import org.apache.spark.sql.datasketches.common.DatasketchesFunctionRegistry
import org.apache.spark.sql.aggregate.{ThetaSketchAggBuild, ThetaSketchAggUnion}
import org.apache.spark.sql.expressions.ThetaSketchGetEstimate
import org.apache.spark.sql.datasketches.theta.aggregate.{ThetaSketchAggBuild, ThetaSketchAggUnion}
import org.apache.spark.sql.datasketches.theta.expressions.ThetaSketchGetEstimate
import org.apache.spark.sql.datasketches.common.DatasketchesFunctionRegistry

object ThetaFunctionRegistry extends DatasketchesFunctionRegistry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
* limitations under the License.
*/

package org.apache.spark.sql.aggregate
package org.apache.spark.sql.datasketches.theta.aggregate

import org.apache.datasketches.theta.{UpdateSketch, SetOperation}
import org.apache.spark.sql.datasketches.theta.types.{ThetaSketchType, ThetaSketchWrapper}

import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes, Expression, ExpressionDescription, Literal}
import org.apache.spark.sql.catalyst.expressions.aggregate.TypedImperativeAggregate
import org.apache.spark.sql.catalyst.trees.BinaryLike
import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType, LongType, NumericType, FloatType, DoubleType, ThetaSketchWrapper, ThetaSketchType}
import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType, LongType, NumericType, FloatType, DoubleType}

/**
* The ThetaSketchBuild function creates a Theta sketch from a column of values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
* limitations under the License.
*/

package org.apache.spark.sql.aggregate
package org.apache.spark.sql.datasketches.theta.aggregate

import org.apache.datasketches.memory.Memory
import org.apache.datasketches.theta.{Sketch, SetOperation}
import org.apache.spark.sql.datasketches.theta.types.{ThetaSketchType, ThetaSketchWrapper}

import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes, Expression, ExpressionDescription, Literal}
import org.apache.spark.sql.catalyst.expressions.aggregate.TypedImperativeAggregate
import org.apache.spark.sql.catalyst.trees.BinaryLike
import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType, ThetaSketchWrapper, ThetaSketchType}
import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType}

/**
* Theta Union operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
* limitations under the License.
*/

package org.apache.spark.sql.expressions
package org.apache.spark.sql.datasketches.theta.expressions

import org.apache.datasketches.memory.Memory
import org.apache.datasketches.theta.Sketch
import org.apache.spark.sql.datasketches.theta.types.ThetaSketchType

import org.apache.spark.sql.catalyst.expressions.{Expression, ExpectsInputTypes, UnaryExpression}
import org.apache.spark.sql.catalyst.expressions.NullIntolerant
import org.apache.spark.sql.catalyst.expressions.ExpressionDescription
import org.apache.spark.sql.catalyst.expressions.codegen.{CodeBlock, CodegenContext, ExprCode}
import org.apache.spark.sql.types.{AbstractDataType, DataType, DoubleType, ThetaSketchType}
import org.apache.spark.sql.types.{AbstractDataType, DataType, DoubleType}

@ExpressionDescription(
usage = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import org.apache.spark.sql.Column
import org.apache.spark.sql.functions.lit

import org.apache.spark.sql.datasketches.common.DatasketchesScalaFunctionBase
import org.apache.spark.sql.aggregate.{ThetaSketchAggBuild, ThetaSketchAggUnion}
import org.apache.spark.sql.expressions.ThetaSketchGetEstimate
import org.apache.spark.sql.datasketches.theta.aggregate.{ThetaSketchAggBuild, ThetaSketchAggUnion}
import org.apache.spark.sql.datasketches.theta.expressions.ThetaSketchGetEstimate
import org.apache.spark.sql.datasketches.common.DatasketchesScalaFunctionBase

object functions extends DatasketchesScalaFunctionBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
* limitations under the License.
*/

package org.apache.spark.sql.types
package org.apache.spark.sql.datasketches.theta.types

import org.apache.spark.sql.types.{DataType, DataTypes, UserDefinedType}

class ThetaSketchType extends UserDefinedType[ThetaSketchWrapper] {
override def sqlType: DataType = DataTypes.BinaryType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.spark.sql.types
package org.apache.spark.sql.datasketches.theta.types

import org.apache.datasketches.theta.{UpdateSketch, CompactSketch, Union}
import org.apache.datasketches.memory.Memory
import org.apache.spark.sql.types.SQLUserDefinedType

@SQLUserDefinedType(udt = classOf[ThetaSketchType])
class ThetaSketchWrapper(var updateSketch: Option[UpdateSketch] = None, var compactSketch: Option[CompactSketch] = None, var union: Option[Union] = None) {
Expand Down

0 comments on commit 050710f

Please sign in to comment.