additional_source.py 968 B

1234567891011121314151617181920212223242526
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. from dataclasses import dataclass
  10. from materialize.output_consistency.expression.expression import Expression
  11. from materialize.output_consistency.query.data_source import DataSource
  12. from materialize.output_consistency.query.join import JoinOperator
  13. @dataclass(kw_only=True, unsafe_hash=True)
  14. class AdditionalSource:
  15. data_source: DataSource
  16. join_operator: JoinOperator
  17. join_constraint: Expression
  18. def as_data_sources(
  19. additional_sources: list[AdditionalSource],
  20. ) -> list[DataSource]:
  21. return [additional_source.data_source for additional_source in additional_sources]