Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QbeastOptions should follow the Builder Pattern #303

Open
osopardo1 opened this issue Apr 4, 2024 · 0 comments
Open

QbeastOptions should follow the Builder Pattern #303

osopardo1 opened this issue Apr 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@osopardo1
Copy link
Member

QbeastOptions is constructed by a Map of Strings containing (or not) different information for writing in a Qbeast table.

The structure of the builder is a Case Class with a companion Object that does the apply().

case class QbeastOptions(
columnsToIndex: Seq[String],
cubeSize: Int,
stats: Option[DataFrame],
txnAppId: Option[String],
txnVersion: Option[String],
userMetadata: Option[String])

We wanted to avoid having "default" fields in the case class, but then we end up having an empty object containing exactly those values.

lazy val empty: QbeastOptions =
QbeastOptions(Seq.empty, DEFAULT_CUBE_SIZE, None, None, None, None)

This issue is to evaluate the creation of QbeastOptions following a Builder Pattern (like in Java) for Scala. Here's a practical guide: https://www.baeldung.com/scala/builder-pattern

@osopardo1 osopardo1 added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant