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

Rework select and filter conversion #3453

Merged
merged 10 commits into from
Jun 12, 2024

Conversation

jnsrnhld
Copy link
Collaborator

@jnsrnhld jnsrnhld commented May 28, 2024

This is "just" a refactoring PR, it did not introduce new features.

Some relevant changes made:

  • Re-introduced SelectConverter and FilterConverter class - SqlAggregators are now just a marker interface to bundle a SelectConverter and FilterConverter if their is a Select and Filter of the same kind (CountSelect, CountFilter, SumSelect, SumFilter, etc.). For Selects which have no corresponding Filter (First, Last, etc.), there exists only a SelectConverter. For Filters which have no corresponding Select (NumberFilter, SelectFilter, etc.), there exists only a FilterConverter.
  • SelectConverters have 2 methods for converting a Select on Concept-level and on Connector-Level.
  • FilterConverters have 2 methods for converting a Filter for Concept-conversion and for table export.
  • A *Holder class for select and filter converters to connect a concrete Select/Filter with their respective converter. This makes casts/more generics on Selects and Filters omitable.
  • Replaced SqlSelects with ConnectorSqlSelects/ConceptSqlSelects.
  • Renamed TablePathGenerator -> TablePath and changed the behavior a little bit.

The majority of all the other changes were just moving existing code around.

@thoniTUB
Copy link
Collaborator

Die Intention hierfür war ja dass, Daterange Columns Dialect abhängig genutzt werden können oder? #3446

@jnsrnhld
Copy link
Collaborator Author

jnsrnhld commented May 30, 2024

@thoniTUB Ich hatte den Ansatz nochmal überdacht: die Möglichkeit, die Daterange Columns zu nutzen ist über bereits existierende Funktionalität aus den StratificationFunctions, die ich im Rahmen der Formulare implementiert hatte, bereits gegeben. Ich habe das jetzt auch in #3446 für Postgres umgesetzt. Damit ist es nicht mehr notwendig, Dialekt-spezifisch einen Converter zu überschreiben.

Die Intention für diesen PR war eher, das die Abstraktionen SqlSelects und ConceptConversionTables aus einer Zeit kommen, wo wir in der Conversion noch nicht zwischen Connector- und Concept-Select unterschieden haben. Jetzt wo fast alle Arten von Selects umgesetzt sind, wollte ich die Abstraktion nochmal verbessern. Plus die anderen oben genannten Punkte.

@jnsrnhld
Copy link
Collaborator Author

jnsrnhld commented Jun 3, 2024

@awildturtok FYI: ich habe die beiden *Holder-Klassen jetzt entfernt.

public class BigMultiSelectFilterConverter extends AbstractSelectFilterConverter<BigMultiSelectFilter, String[]> {

@Override
protected String[] getValues(FilterContext<String[]> filterContext) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die abstraktion musst du gar nicht machen, Big/-Multi sind fürs FE relevant und ein bisschen, wie wir sie aufbereiten dafür im Backend. Logik ist die gleiche

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was meinst du mit "muss ich nicht machen?" Heißt das im Backend kommt immer nur ein SelectFilter und für Big/Multi brauch ich keinen Converter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awildturtok Nur nochmal ein Ping für ☝️

Copy link
Collaborator

@awildturtok awildturtok Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry habe das nicht in meinen PRs gesehen. du kannst für beide den gleichen converter verwenden.

Kurze warunung, ich habe vor die FilterValue von BigMult und Multi auf Set zu migrieren. Das nicht zu machen hat bei uns zu performance problemen geführt.

jnsrnhld and others added 5 commits June 6, 2024 12:29
…and-filter-conversion

# Conflicts:
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/Select.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/concept/specific/EventDateUnionSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/concept/specific/EventDurationSumSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/concept/specific/ExistsSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/connector/specific/CountQuartersSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/connector/specific/CountSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/connector/specific/DateDistanceSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/connector/specific/FlagSelect.java
#	backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/select/connector/specific/SumSelect.java
@jnsrnhld jnsrnhld enabled auto-merge (squash) June 12, 2024 19:52
@jnsrnhld jnsrnhld disabled auto-merge June 12, 2024 19:56
@jnsrnhld jnsrnhld enabled auto-merge (squash) June 12, 2024 20:00
@jnsrnhld jnsrnhld merged commit 94657e1 into develop Jun 12, 2024
6 checks passed
@jnsrnhld jnsrnhld deleted the sql/refactoring/rework-select-and-filter-conversion branch June 13, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants