From e3d972fb28f963d085ceeb40145d4d2e46313a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pa=C5=82ka?= Date: Tue, 30 Aug 2022 16:33:17 +0200 Subject: [PATCH] Rename packages to ...iskra --- README.md | 2 +- publish-conf.scala | 6 +++--- src/main/Aliasing.scala | 2 +- src/main/Column.scala | 2 +- src/main/ColumnOp.scala | 8 ++++---- src/main/DataFrame.scala | 2 +- src/main/DataFrameBuilders.scala | 6 +++--- src/main/FrameSchema.scala | 2 +- src/main/Grouping.scala | 4 ++-- src/main/Join.scala | 2 +- src/main/JoinOnCondition.scala | 4 ++-- src/main/MacroHelpers.scala | 4 ++-- src/main/Name.scala | 2 +- src/main/SchemaView.scala | 2 +- src/main/Select.scala | 2 +- src/main/UntypedOps.scala | 2 +- src/main/Where.scala | 4 ++-- src/main/api/api.scala | 10 +++++----- src/main/functions/aggregates.scala | 12 ++++++------ src/main/functions/lit.scala | 6 +++--- src/main/types/DataType.scala | 2 +- src/main/untyped.scala | 2 +- src/test/AggregatorsTest.scala | 4 ++-- src/test/CompilationTest.scala | 18 +++++++++--------- src/test/OperatorsTest.scala | 4 ++-- src/test/SparkUnitTest.scala | 4 ++-- src/test/WhereTest.scala | 4 ++-- src/test/example/Books.scala | 4 ++-- src/test/example/Countries.scala | 4 ++-- src/test/example/Workers.scala | 4 ++-- 30 files changed, 67 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index ff658f6..0abcbd4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Iskra tries to work around this problem by using its own encoders (unrelated to ## How does Iskra make things typesafe and efficient at the same time? -TypedFrames provides thin (but strongly typed) wrappers around `DataFrame`s, which track types and names of columns at compile time but let Catalyst perform all of its optimizations at runtime. +Iskra provides thin (but strongly typed) wrappers around `DataFrame`s, which track types and names of columns at compile time but let Catalyst perform all of its optimizations at runtime. Iskra uses structural types rather than case classes as data models, which gives us a lot of flexibility (no need to explicitly define a new case class when a column is added/removed/renamed!) but we still get compilation errors when we try to refer to a column which doesn't exist or can't be used in a given context. diff --git a/publish-conf.scala b/publish-conf.scala index ea68811..c3bb279 100644 --- a/publish-conf.scala +++ b/publish-conf.scala @@ -1,8 +1,8 @@ //> using publish.organization "org.virtuslab" -//> using publish.name "typed-frames" +//> using publish.name "iskra" //> using publish.computeVersion "git:tag" -//> using publish.url "https://github.com/VirtusLab/typed-frames" -//> using publish.versionControl "scm:git:github.com/VirtusLab/typed-frames.git" +//> using publish.url "https://github.com/VirtusLab/iskra" +//> using publish.versionControl "scm:git:github.com/VirtusLab/iskra.git" //> using publish.license "Apache-2.0" //> using publish.repository "central" //> using publish.developer "prolativ|Michał Pałka|https://github.com/prolativ" \ No newline at end of file diff --git a/src/main/Aliasing.scala b/src/main/Aliasing.scala index e80de53..ec65275 100644 --- a/src/main/Aliasing.scala +++ b/src/main/Aliasing.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* diff --git a/src/main/Column.scala b/src/main/Column.scala index d9dcb6d..b1fd5ca 100644 --- a/src/main/Column.scala +++ b/src/main/Column.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import org.apache.spark.sql.{ Column => UntypedColumn} import types.DataType diff --git a/src/main/ColumnOp.scala b/src/main/ColumnOp.scala index e980c93..fcdd121 100644 --- a/src/main/ColumnOp.scala +++ b/src/main/ColumnOp.scala @@ -1,11 +1,11 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* import org.apache.spark.sql import org.apache.spark.sql.functions.concat -import org.virtuslab.typedframes.{Column as Col} -import org.virtuslab.typedframes.UntypedOps.typed -import org.virtuslab.typedframes.types.* +import org.virtuslab.iskra.{Column as Col} +import org.virtuslab.iskra.UntypedOps.typed +import org.virtuslab.iskra.types.* import DataType.* object ColumnOp: diff --git a/src/main/DataFrame.scala b/src/main/DataFrame.scala index be99f82..9a4fc80 100644 --- a/src/main/DataFrame.scala +++ b/src/main/DataFrame.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import org.apache.spark.sql import org.apache.spark.sql.SparkSession diff --git a/src/main/DataFrameBuilders.scala b/src/main/DataFrameBuilders.scala index 7424967..ee92fbc 100644 --- a/src/main/DataFrameBuilders.scala +++ b/src/main/DataFrameBuilders.scala @@ -1,10 +1,10 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted._ import org.apache.spark.sql import org.apache.spark.sql.SparkSession -import org.virtuslab.typedframes.DataFrame -import org.virtuslab.typedframes.types.{DataType, StructType} +import org.virtuslab.iskra.DataFrame +import org.virtuslab.iskra.types.{DataType, StructType} import DataType.{Encoder, StructEncoder, PrimitiveEncoder} object DataFrameBuilders: diff --git a/src/main/FrameSchema.scala b/src/main/FrameSchema.scala index 9c6adfa..0a58b80 100644 --- a/src/main/FrameSchema.scala +++ b/src/main/FrameSchema.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* import scala.deriving.Mirror diff --git a/src/main/Grouping.scala b/src/main/Grouping.scala index c0dbc45..68475bd 100644 --- a/src/main/Grouping.scala +++ b/src/main/Grouping.scala @@ -1,7 +1,7 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* -import org.virtuslab.typedframes.types.DataType +import org.virtuslab.iskra.types.DataType import MacroHelpers.TupleSubtype class GroupBy[View <: SchemaView](val view: View, val underlying: UntypedDataFrame) diff --git a/src/main/Join.scala b/src/main/Join.scala index 9b438cb..8da27b3 100644 --- a/src/main/Join.scala +++ b/src/main/Join.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* diff --git a/src/main/JoinOnCondition.scala b/src/main/JoinOnCondition.scala index 627d4db..799fb1b 100644 --- a/src/main/JoinOnCondition.scala +++ b/src/main/JoinOnCondition.scala @@ -1,7 +1,7 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* -import org.virtuslab.typedframes.types.BooleanOptType +import org.virtuslab.iskra.types.BooleanOptType abstract class JoinOnCondition[MergedSchema, MergedView <: SchemaView]( val left: UntypedDataFrame, val right: UntypedDataFrame, val joinType: JoinType diff --git a/src/main/MacroHelpers.scala b/src/main/MacroHelpers.scala index 7925bc1..f35422c 100644 --- a/src/main/MacroHelpers.scala +++ b/src/main/MacroHelpers.scala @@ -1,8 +1,8 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* -private[typedframes] object MacroHelpers: +private[iskra] object MacroHelpers: def callPosition(ownerExpr: Expr[?])(using Quotes): quotes.reflect.Position = import quotes.reflect.* val file = Position.ofMacroExpansion.sourceFile diff --git a/src/main/Name.scala b/src/main/Name.scala index ea224b6..adf772f 100644 --- a/src/main/Name.scala +++ b/src/main/Name.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra type Name = String & Singleton object Name: diff --git a/src/main/SchemaView.scala b/src/main/SchemaView.scala index d683946..4270af0 100644 --- a/src/main/SchemaView.scala +++ b/src/main/SchemaView.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted._ import org.apache.spark.sql.functions.col diff --git a/src/main/Select.scala b/src/main/Select.scala index e8b5600..cb1d1ab 100644 --- a/src/main/Select.scala +++ b/src/main/Select.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* import MacroHelpers.TupleSubtype diff --git a/src/main/UntypedOps.scala b/src/main/UntypedOps.scala index 1f321aa..e5a03fb 100644 --- a/src/main/UntypedOps.scala +++ b/src/main/UntypedOps.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* import types.{DataType, StructType} diff --git a/src/main/Where.scala b/src/main/Where.scala index 1802d82..4b96d8e 100644 --- a/src/main/Where.scala +++ b/src/main/Where.scala @@ -1,9 +1,9 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra import scala.quoted.* import scala.annotation.implicitNotFound -import org.virtuslab.typedframes.types.BooleanOptType +import org.virtuslab.iskra.types.BooleanOptType trait Where[Schema, View <: SchemaView]: val view: View diff --git a/src/main/api/api.scala b/src/main/api/api.scala index f66a5e1..aae1a19 100644 --- a/src/main/api/api.scala +++ b/src/main/api/api.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra package api export DataFrameBuilders.toTypedDF @@ -24,11 +24,11 @@ export types.{ StructOptType } export UntypedOps.typed -export org.virtuslab.typedframes.$ -export org.virtuslab.typedframes.{Column, DataFrame, UntypedColumn, UntypedDataFrame} +export org.virtuslab.iskra.$ +export org.virtuslab.iskra.{Column, DataFrame, UntypedColumn, UntypedDataFrame} object functions: - export org.virtuslab.typedframes.functions.lit - export org.virtuslab.typedframes.functions.Aggregates.* + export org.virtuslab.iskra.functions.lit + export org.virtuslab.iskra.functions.Aggregates.* export org.apache.spark.sql.SparkSession diff --git a/src/main/functions/aggregates.scala b/src/main/functions/aggregates.scala index 11769d3..13dce93 100644 --- a/src/main/functions/aggregates.scala +++ b/src/main/functions/aggregates.scala @@ -1,11 +1,11 @@ -package org.virtuslab.typedframes.functions +package org.virtuslab.iskra.functions import org.apache.spark.sql -import org.virtuslab.typedframes.Agg -import org.virtuslab.typedframes.Column -import org.virtuslab.typedframes.UntypedOps.typed -import org.virtuslab.typedframes.types.* -import org.virtuslab.typedframes.types.DataType.{NumericOptType, Nullable} +import org.virtuslab.iskra.Agg +import org.virtuslab.iskra.Column +import org.virtuslab.iskra.UntypedOps.typed +import org.virtuslab.iskra.types.* +import org.virtuslab.iskra.types.DataType.{NumericOptType, Nullable} class Sum[A <: Agg](val agg: A): def apply[T <: NumericOptType](column: agg.View ?=> Column[T]): Column[Nullable[T]] = diff --git a/src/main/functions/lit.scala b/src/main/functions/lit.scala index f1b442e..ffe5c7f 100644 --- a/src/main/functions/lit.scala +++ b/src/main/functions/lit.scala @@ -1,7 +1,7 @@ -package org.virtuslab.typedframes.functions +package org.virtuslab.iskra.functions import org.apache.spark.sql -import org.virtuslab.typedframes.Column -import org.virtuslab.typedframes.types.DataType.PrimitiveEncoder +import org.virtuslab.iskra.Column +import org.virtuslab.iskra.types.DataType.PrimitiveEncoder def lit[A](value: A)(using encoder: PrimitiveEncoder[A]): Column[encoder.ColumnType] = Column(sql.functions.lit(encoder.encode(value))) diff --git a/src/main/types/DataType.scala b/src/main/types/DataType.scala index d5f3bcd..2198d11 100644 --- a/src/main/types/DataType.scala +++ b/src/main/types/DataType.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra package types import scala.quoted._ diff --git a/src/main/untyped.scala b/src/main/untyped.scala index cebd263..c7517fa 100644 --- a/src/main/untyped.scala +++ b/src/main/untyped.scala @@ -1,4 +1,4 @@ -package org.virtuslab.typedframes +package org.virtuslab.iskra type UntypedDataFrame = org.apache.spark.sql.DataFrame type UntypedColumn = org.apache.spark.sql.Column diff --git a/src/test/AggregatorsTest.scala b/src/test/AggregatorsTest.scala index 5764c91..be66e87 100644 --- a/src/test/AggregatorsTest.scala +++ b/src/test/AggregatorsTest.scala @@ -1,7 +1,7 @@ -package org.virtuslab.typedframes.test +package org.virtuslab.iskra.test class AggregatorsTest extends SparkUnitTest("AggregatorsTest"): - import org.virtuslab.typedframes.api.* + import org.virtuslab.iskra.api.* import functions.* case class Foo(string: String, int: Int, intOpt: Option[Int], float: Float, floatOpt: Option[Float]) diff --git a/src/test/CompilationTest.scala b/src/test/CompilationTest.scala index fbf082b..a3502ac 100644 --- a/src/test/CompilationTest.scala +++ b/src/test/CompilationTest.scala @@ -1,17 +1,17 @@ -package org.virtuslab.typedframes.test +package org.virtuslab.iskra.test import org.scalatest.funsuite.AnyFunSuite class CompilationTest extends AnyFunSuite: test("Wrong collect type") { assertCompiles(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val elements = Seq(1, 2, 3).toTypedDF.collectAs[Int] |""".stripMargin) assertDoesNotCompile(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val elements = Seq(1, 2, 3).toTypedDF.collectAs[String] |""".stripMargin) @@ -19,14 +19,14 @@ class CompilationTest extends AnyFunSuite: test("Select nonexistent column") { assertCompiles(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |case class Foo(string: String) |given spark: SparkSession = ??? |val elements = Seq(Foo("abc")).toTypedDF.select($.string) |""".stripMargin) assertDoesNotCompile(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |case class Foo(string: String) |given spark: SparkSession = ??? |val elements = Seq(Foo("abc")).toTypedDF.select($.strin) @@ -35,25 +35,25 @@ class CompilationTest extends AnyFunSuite: test("Collect nullable") { assertCompiles(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val result = Seq(1, 2).toTypedDF.collectAs[Int] |""".stripMargin) assertCompiles(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val result = Seq(1, 2).toTypedDF.collectAs[Option[Int]] |""".stripMargin) assertDoesNotCompile(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val result = Seq(Some(1), None).toTypedDF.collectAs[Int] |""".stripMargin) assertCompiles(""" - |import org.virtuslab.typedframes.api.* + |import org.virtuslab.iskra.api.* |given spark: SparkSession = ??? |val result = Seq(Some(1), None).toTypedDF.collectAs[Option[Int]] |""".stripMargin) diff --git a/src/test/OperatorsTest.scala b/src/test/OperatorsTest.scala index 5d2196e..153a29a 100644 --- a/src/test/OperatorsTest.scala +++ b/src/test/OperatorsTest.scala @@ -1,11 +1,11 @@ -package org.virtuslab.typedframes.test +package org.virtuslab.iskra.test import org.scalatest.funsuite.AnyFunSuite import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers.shouldEqual class OperatorsTest extends SparkUnitTest("OperatorsTest"): - import org.virtuslab.typedframes.api.* + import org.virtuslab.iskra.api.* case class Foo(boolean: Boolean, string: String, byte: Byte, short: Short, int: Int, long: Long, float: Float, double: Double) case class Bar(int: Int, intSome: Option[Int], intNone: Option[Int]) diff --git a/src/test/SparkUnitTest.scala b/src/test/SparkUnitTest.scala index 9eaff2a..ef41856 100644 --- a/src/test/SparkUnitTest.scala +++ b/src/test/SparkUnitTest.scala @@ -1,8 +1,8 @@ -package org.virtuslab.typedframes.test +package org.virtuslab.iskra.test import org.scalatest.funsuite.AnyFunSuite import org.scalatest.BeforeAndAfterAll -import org.virtuslab.typedframes.api.* +import org.virtuslab.iskra.api.* abstract class SparkUnitTest(suiteName: String) extends AnyFunSuite, BeforeAndAfterAll: given spark: SparkSession = diff --git a/src/test/WhereTest.scala b/src/test/WhereTest.scala index c27e1e7..105e7fe 100644 --- a/src/test/WhereTest.scala +++ b/src/test/WhereTest.scala @@ -1,11 +1,11 @@ -package org.virtuslab.typedframes.test +package org.virtuslab.iskra.test import org.scalatest.funsuite.AnyFunSuite import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers.shouldEqual class WhereTest extends SparkUnitTest("WhereTest"): - import org.virtuslab.typedframes.api.* + import org.virtuslab.iskra.api.* import functions.lit case class Foo(int: Int, intOpt: Option[Int]) diff --git a/src/test/example/Books.scala b/src/test/example/Books.scala index 147d783..ca0bdcf 100644 --- a/src/test/example/Books.scala +++ b/src/test/example/Books.scala @@ -1,6 +1,6 @@ -package org.virtuslab.typedframes.example.books +package org.virtuslab.iskra.example.books -import org.virtuslab.typedframes.api.* +import org.virtuslab.iskra.api.* @main def runExample(dataFilePath: String): Unit = given spark: SparkSession = { diff --git a/src/test/example/Countries.scala b/src/test/example/Countries.scala index 130f159..69fa906 100644 --- a/src/test/example/Countries.scala +++ b/src/test/example/Countries.scala @@ -1,6 +1,6 @@ -package org.virtuslab.typedframes.example.countries +package org.virtuslab.iskra.example.countries -import org.virtuslab.typedframes.api.* +import org.virtuslab.iskra.api.* import functions.avg @main def runExample(): Unit = diff --git a/src/test/example/Workers.scala b/src/test/example/Workers.scala index 3914774..45352fa 100644 --- a/src/test/example/Workers.scala +++ b/src/test/example/Workers.scala @@ -1,6 +1,6 @@ -package org.virtuslab.typedframes.example.workers +package org.virtuslab.iskra.example.workers -import org.virtuslab.typedframes.api.* +import org.virtuslab.iskra.api.* import functions.lit @main def runExample(): Unit =