deltacat 0.1.18b1__tar.gz → 0.1.18b3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. deltacat-0.1.18b3/LICENSE +201 -0
  2. deltacat-0.1.18b3/PKG-INFO +35 -0
  3. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/__init__.py +1 -1
  4. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/compaction_session.py +62 -25
  5. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/delta_annotated.py +1 -1
  6. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/materialize_result.py +16 -2
  7. deltacat-0.1.18b3/deltacat/compute/compactor/model/repartition_result.py +6 -0
  8. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/round_completion_info.py +8 -0
  9. deltacat-0.1.18b3/deltacat/compute/compactor/repartition_session.py +174 -0
  10. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/materialize.py +116 -27
  11. deltacat-0.1.18b3/deltacat/compute/compactor/steps/repartition.py +210 -0
  12. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/utils/io.py +131 -49
  13. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/utils/round_completion_file.py +14 -16
  14. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/constants.py +2 -0
  15. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/interface.py +1 -1
  16. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/types.py +10 -2
  17. deltacat-0.1.18b3/deltacat/tests/compactor/utils/test_io.py +69 -0
  18. deltacat-0.1.18b3/deltacat/tests/test_repartition.py +193 -0
  19. deltacat-0.1.18b3/deltacat/tests/test_utils/constants.py +7 -0
  20. deltacat-0.1.18b3/deltacat/tests/utils/test_resources.py +36 -0
  21. deltacat-0.1.18b3/deltacat/utils/__init__.py +0 -0
  22. deltacat-0.1.18b3/deltacat/utils/ray_utils/__init__.py +0 -0
  23. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/ray_utils/concurrency.py +2 -0
  24. deltacat-0.1.18b3/deltacat/utils/resources.py +72 -0
  25. deltacat-0.1.18b3/deltacat.egg-info/PKG-INFO +35 -0
  26. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat.egg-info/SOURCES.txt +12 -1
  27. deltacat-0.1.18b1/PKG-INFO +0 -36
  28. deltacat-0.1.18b1/deltacat.egg-info/PKG-INFO +0 -36
  29. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/MANIFEST.in +0 -0
  30. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/README.md +0 -0
  31. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/__init__.py +0 -0
  32. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/clients.py +0 -0
  33. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/constants.py +0 -0
  34. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/redshift/__init__.py +0 -0
  35. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/redshift/model/__init__.py +0 -0
  36. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/redshift/model/manifest.py +0 -0
  37. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/aws/s3u.py +0 -0
  38. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/__init__.py +0 -0
  39. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/delegate.py +0 -0
  40. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/interface.py +0 -0
  41. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/model/__init__.py +0 -0
  42. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/model/catalog.py +0 -0
  43. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/catalog/model/table_definition.py +0 -0
  44. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/__init__.py +0 -0
  45. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/__init__.py +0 -0
  46. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/__init__.py +0 -0
  47. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/dedupe_result.py +0 -0
  48. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/delta_file_envelope.py +0 -0
  49. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/delta_file_locator.py +0 -0
  50. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/hash_bucket_result.py +0 -0
  51. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/primary_key_index.py +0 -0
  52. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/pyarrow_write_result.py +0 -0
  53. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/model/sort_key.py +0 -0
  54. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/__init__.py +0 -0
  55. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/dedupe.py +0 -0
  56. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/hash_bucket.py +0 -0
  57. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/rehash/__init__.py +0 -0
  58. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/rehash/rehash_bucket.py +0 -0
  59. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/steps/rehash/rewrite_index.py +0 -0
  60. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/utils/__init__.py +0 -0
  61. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/utils/primary_key_index.py +0 -0
  62. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/compactor/utils/system_columns.py +0 -0
  63. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/__init__.py +0 -0
  64. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/config/__init__.py +0 -0
  65. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/meta_stats.py +0 -0
  66. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/model/__init__.py +0 -0
  67. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/model/partition_stats_dict.py +0 -0
  68. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/model/stats_cluster_size_estimator.py +0 -0
  69. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/stats.py +0 -0
  70. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/utils/__init__.py +0 -0
  71. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/utils/constants.py +0 -0
  72. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/utils/io.py +0 -0
  73. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/utils/pyarrow_memory_estimation_function.py +0 -0
  74. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/metastats/utils/ray_utils.py +0 -0
  75. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/__init__.py +0 -0
  76. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/basic.py +0 -0
  77. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/__init__.py +0 -0
  78. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/delta_column_stats.py +0 -0
  79. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/delta_stats.py +0 -0
  80. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/delta_stats_cache_result.py +0 -0
  81. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/manifest_entry_stats.py +0 -0
  82. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/models/stats_result.py +0 -0
  83. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/types.py +0 -0
  84. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/utils/__init__.py +0 -0
  85. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/utils/intervals.py +0 -0
  86. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/utils/io.py +0 -0
  87. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/compute/stats/utils/manifest_stats_file.py +0 -0
  88. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/exceptions.py +0 -0
  89. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/__init__.py +0 -0
  90. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/aws/__init__.py +0 -0
  91. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/aws/redshift/__init__.py +0 -0
  92. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/aws/redshift/redshift_datasource.py +0 -0
  93. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/dataset.py +0 -0
  94. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/io/read_api.py +0 -0
  95. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/logs.py +0 -0
  96. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/__init__.py +0 -0
  97. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/__init__.py +0 -0
  98. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/delta.py +0 -0
  99. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/list_result.py +0 -0
  100. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/locator.py +0 -0
  101. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/namespace.py +0 -0
  102. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/partition.py +0 -0
  103. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/stream.py +0 -0
  104. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/table.py +0 -0
  105. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/storage/model/table_version.py +0 -0
  106. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/tests/__init__.py +0 -0
  107. {deltacat-0.1.18b1/deltacat/tests/stats → deltacat-0.1.18b3/deltacat/tests/compactor}/__init__.py +0 -0
  108. {deltacat-0.1.18b1/deltacat/tests → deltacat-0.1.18b3/deltacat/tests/compactor}/utils/__init__.py +0 -0
  109. {deltacat-0.1.18b1/deltacat/types → deltacat-0.1.18b3/deltacat/tests/stats}/__init__.py +0 -0
  110. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/tests/stats/test_intervals.py +0 -0
  111. {deltacat-0.1.18b1/deltacat/utils → deltacat-0.1.18b3/deltacat/tests/test_utils}/__init__.py +0 -0
  112. {deltacat-0.1.18b1/deltacat/utils/ray_utils → deltacat-0.1.18b3/deltacat/tests/utils}/__init__.py +0 -0
  113. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/tests/utils/test_record_batch_tables.py +0 -0
  114. /deltacat-0.1.18b1/deltacat/utils/profiling.py → /deltacat-0.1.18b3/deltacat/types/__init__.py +0 -0
  115. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/types/media.py +0 -0
  116. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/types/tables.py +0 -0
  117. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/common.py +0 -0
  118. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/metrics.py +0 -0
  119. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/numpy.py +0 -0
  120. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/pandas.py +0 -0
  121. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/performance.py +0 -0
  122. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/placement.py +0 -0
  123. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/pyarrow.py +0 -0
  124. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/ray_utils/collections.py +0 -0
  125. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/ray_utils/dataset.py +0 -0
  126. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/ray_utils/performance.py +0 -0
  127. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat/utils/ray_utils/runtime.py +0 -0
  128. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat.egg-info/dependency_links.txt +0 -0
  129. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat.egg-info/requires.txt +0 -0
  130. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/deltacat.egg-info/top_level.txt +0 -0
  131. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/setup.cfg +0 -0
  132. {deltacat-0.1.18b1 → deltacat-0.1.18b3}/setup.py +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.1
2
+ Name: deltacat
3
+ Version: 0.1.18b3
4
+ Summary: A scalable, fast, ACID-compliant Data Catalog powered by Ray.
5
+ Home-page: https://github.com/ray-project/deltacat
6
+ Author: Ray Team
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+
18
+ # DeltaCAT
19
+
20
+ DeltaCAT is a Pythonic Data Catalog powered by Ray.
21
+
22
+ Its data storage model allows you to define and manage fast, scalable,
23
+ ACID-compliant data catalogs through git-like stage/commit APIs, and has been
24
+ used to successfully host exabyte-scale enterprise data lakes.
25
+
26
+ DeltaCAT uses the Ray distributed compute framework together with Apache Arrow
27
+ for common table management tasks, including petabyte-scale
28
+ change-data-capture, data consistency checks, and table repair.
29
+
30
+ ## Getting Started
31
+ ---
32
+ ### Install
33
+ ```
34
+ pip install deltacat
35
+ ```
@@ -43,7 +43,7 @@ from deltacat.types.tables import TableWriteMode
43
43
 
44
44
  deltacat.logs.configure_deltacat_logger(logging.getLogger(__name__))
45
45
 
46
- __version__ = "0.1.18.beta1"
46
+ __version__ = "0.1.18b3"
47
47
 
48
48
 
49
49
  __all__ = [
@@ -37,6 +37,7 @@ from deltacat.utils.placement import PlacementGroupConfig
37
37
  from typing import List, Set, Optional, Tuple, Dict, Any
38
38
  from collections import defaultdict
39
39
  from deltacat.utils.metrics import MetricsConfig
40
+ from deltacat.utils.resources import log_current_cluster_utilization
40
41
 
41
42
  if importlib.util.find_spec("memray"):
42
43
  import memray
@@ -113,8 +114,11 @@ def compact_partition(
113
114
  f"compaction_partition.bin"
114
115
  ) if enable_profiler else nullcontext():
115
116
  partition = None
116
- new_rcf_s3_url = None
117
- (new_partition, new_rci, new_rcf_s3_url,) = _execute_compaction_round(
117
+ (
118
+ new_partition,
119
+ new_rci,
120
+ new_rcf_partition_locator,
121
+ ) = _execute_compaction_round(
118
122
  source_partition_locator,
119
123
  destination_partition_locator,
120
124
  primary_keys,
@@ -144,12 +148,19 @@ def compact_partition(
144
148
  logger.info(
145
149
  f"Partition-{source_partition_locator.partition_values}-> Compaction session data processing completed"
146
150
  )
151
+ round_completion_file_s3_url = None
147
152
  if partition:
148
153
  logger.info(f"Committing compacted partition to: {partition.locator}")
149
154
  partition = deltacat_storage.commit_partition(partition)
150
155
  logger.info(f"Committed compacted partition: {partition}")
156
+
157
+ round_completion_file_s3_url = rcf.write_round_completion_file(
158
+ compaction_artifact_s3_bucket,
159
+ new_rcf_partition_locator,
160
+ new_rci,
161
+ )
151
162
  logger.info(f"Completed compaction session for: {source_partition_locator}")
152
- return new_rcf_s3_url
163
+ return round_completion_file_s3_url
153
164
 
154
165
 
155
166
  def _execute_compaction_round(
@@ -283,13 +294,22 @@ def _execute_compaction_round(
283
294
  hash_bucket_count,
284
295
  last_stream_position_compacted,
285
296
  require_multiple_rounds,
286
- ) = io.limit_input_deltas(
287
- input_deltas,
288
- cluster_resources,
289
- hash_bucket_count,
290
- min_hash_bucket_chunk_size,
291
- input_deltas_stats=input_deltas_stats,
292
- deltacat_storage=deltacat_storage,
297
+ ) = (
298
+ io.fit_input_deltas(
299
+ input_deltas,
300
+ cluster_resources,
301
+ hash_bucket_count,
302
+ deltacat_storage=deltacat_storage,
303
+ )
304
+ if input_deltas_stats is None
305
+ else io.limit_input_deltas(
306
+ input_deltas,
307
+ cluster_resources,
308
+ hash_bucket_count,
309
+ min_hash_bucket_chunk_size,
310
+ input_deltas_stats=input_deltas_stats,
311
+ deltacat_storage=deltacat_storage,
312
+ )
293
313
  )
294
314
 
295
315
  assert hash_bucket_count is not None and hash_bucket_count > 0, (
@@ -435,11 +455,39 @@ def _execute_compaction_round(
435
455
  )
436
456
  logger.info(f"Getting {len(mat_tasks_pending)} materialize result(s)...")
437
457
  mat_results = ray.get(mat_tasks_pending)
458
+ total_count_of_src_dfl_not_touched = sum(
459
+ m.count_of_src_dfl_not_touched for m in mat_results
460
+ )
461
+ total_length_src_dfl = sum(m.count_of_src_dfl for m in mat_results)
462
+ logger.info(
463
+ f"Got total of {total_count_of_src_dfl_not_touched} manifest files not touched."
464
+ )
465
+ logger.info(
466
+ f"Got total of {total_length_src_dfl} manifest files during compaction."
467
+ )
468
+ manifest_entry_copied_by_reference_ratio = (
469
+ (round(total_count_of_src_dfl_not_touched / total_length_src_dfl, 4) * 100)
470
+ if total_length_src_dfl != 0
471
+ else None
472
+ )
473
+ logger.info(
474
+ f"{manifest_entry_copied_by_reference_ratio} percent of manifest files are copied by reference during materialize."
475
+ )
476
+
438
477
  logger.info(f"Got {len(mat_results)} materialize result(s).")
439
478
 
479
+ log_current_cluster_utilization(log_identifier="post_materialize")
480
+
440
481
  mat_results = sorted(mat_results, key=lambda m: m.task_index)
441
482
  deltas = [m.delta for m in mat_results]
442
- merged_delta = Delta.merge_deltas(deltas)
483
+
484
+ # Note: An appropriate last stream position must be set
485
+ # to avoid correctness issue.
486
+ merged_delta = Delta.merge_deltas(
487
+ deltas,
488
+ stream_position=last_stream_position_to_compact,
489
+ )
490
+
443
491
  record_info_msg = (
444
492
  f"Hash bucket records: {total_hb_record_count},"
445
493
  f" Deduped records: {total_dd_record_count}, "
@@ -463,35 +511,24 @@ def _execute_compaction_round(
463
511
  compacted_delta.stream_position,
464
512
  )
465
513
 
466
- rci_high_watermark = (
467
- rebase_source_partition_high_watermark
468
- if rebase_source_partition_high_watermark
469
- else last_stream_position_compacted
470
- )
471
-
472
514
  last_rebase_source_partition_locator = rebase_source_partition_locator or (
473
515
  round_completion_info.rebase_source_partition_locator
474
516
  if round_completion_info
475
517
  else None
476
518
  )
477
519
  new_round_completion_info = RoundCompletionInfo.of(
478
- rci_high_watermark,
520
+ last_stream_position_compacted,
479
521
  new_compacted_delta_locator,
480
522
  PyArrowWriteResult.union([m.pyarrow_write_result for m in mat_results]),
481
523
  bit_width_of_sort_keys,
482
524
  last_rebase_source_partition_locator,
525
+ manifest_entry_copied_by_reference_ratio,
483
526
  )
484
527
  rcf_source_partition_locator = (
485
528
  rebase_source_partition_locator
486
529
  if rebase_source_partition_locator
487
530
  else source_partition_locator
488
531
  )
489
- round_completion_file_s3_url = rcf.write_round_completion_file(
490
- compaction_artifact_s3_bucket,
491
- rcf_source_partition_locator,
492
- new_round_completion_info,
493
- )
494
-
495
532
  logger.info(
496
533
  f"partition-{source_partition_locator.partition_values},"
497
534
  f"compacted at: {last_stream_position_compacted},"
@@ -500,5 +537,5 @@ def _execute_compaction_round(
500
537
  return (
501
538
  partition,
502
539
  new_round_completion_info,
503
- round_completion_file_s3_url,
540
+ rcf_source_partition_locator,
504
541
  )
@@ -62,7 +62,7 @@ class DeltaAnnotated(Delta):
62
62
  @staticmethod
63
63
  def rebatch(
64
64
  annotated_deltas: List[DeltaAnnotated],
65
- min_delta_bytes,
65
+ min_delta_bytes: float,
66
66
  min_file_counts: Optional[Union[int, float]] = float("inf"),
67
67
  estimation_function: Optional[Callable] = None,
68
68
  ) -> List[DeltaAnnotated]:
@@ -1,7 +1,7 @@
1
1
  # Allow classes to use self-referencing Type hints in Python 3.7.
2
2
  from __future__ import annotations
3
3
 
4
- from typing import Any, Dict
4
+ from typing import Any, Dict, Optional
5
5
 
6
6
  from deltacat.compute.compactor.model.pyarrow_write_result import PyArrowWriteResult
7
7
  from deltacat.storage import Delta
@@ -10,12 +10,18 @@ from deltacat.storage import Delta
10
10
  class MaterializeResult(dict):
11
11
  @staticmethod
12
12
  def of(
13
- delta: Delta, task_index: int, pyarrow_write_result: PyArrowWriteResult
13
+ delta: Delta,
14
+ task_index: int,
15
+ pyarrow_write_result: PyArrowWriteResult,
16
+ count_of_src_dfl_not_touched: Optional[int] = 0,
17
+ count_of_src_dfl: Optional[int] = 0,
14
18
  ) -> MaterializeResult:
15
19
  materialize_result = MaterializeResult()
16
20
  materialize_result["delta"] = delta
17
21
  materialize_result["taskIndex"] = task_index
18
22
  materialize_result["paWriteResult"] = pyarrow_write_result
23
+ materialize_result["countOfSrcFileNotTouched"] = count_of_src_dfl_not_touched
24
+ materialize_result["countOfSrcFile"] = count_of_src_dfl
19
25
  return materialize_result
20
26
 
21
27
  @property
@@ -35,3 +41,11 @@ class MaterializeResult(dict):
35
41
  if val is not None and not isinstance(val, PyArrowWriteResult):
36
42
  self["paWriteResult"] = val = PyArrowWriteResult(val)
37
43
  return val
44
+
45
+ @property
46
+ def count_of_src_dfl_not_touched(self) -> int:
47
+ return self["countOfSrcFileNotTouched"]
48
+
49
+ @property
50
+ def count_of_src_dfl(self) -> int:
51
+ return self["countOfSrcFile"]
@@ -0,0 +1,6 @@
1
+ from typing import NamedTuple, List
2
+ from deltacat.storage import Delta
3
+
4
+
5
+ class RepartitionResult(NamedTuple):
6
+ range_deltas: List[Delta]
@@ -38,6 +38,7 @@ class RoundCompletionInfo(dict):
38
38
  compacted_pyarrow_write_result: PyArrowWriteResult,
39
39
  sort_keys_bit_width: int,
40
40
  rebase_source_partition_locator: Optional[PartitionLocator],
41
+ manifest_entry_copied_by_reference_ratio: Optional[float] = None,
41
42
  ) -> RoundCompletionInfo:
42
43
 
43
44
  rci = RoundCompletionInfo()
@@ -46,6 +47,9 @@ class RoundCompletionInfo(dict):
46
47
  rci["compactedPyarrowWriteResult"] = compacted_pyarrow_write_result
47
48
  rci["sortKeysBitWidth"] = sort_keys_bit_width
48
49
  rci["rebaseSourcePartitionLocator"] = rebase_source_partition_locator
50
+ rci[
51
+ "manifestEntryCopiedByReferenceRatio"
52
+ ] = manifest_entry_copied_by_reference_ratio
49
53
  return rci
50
54
 
51
55
  @property
@@ -80,3 +84,7 @@ class RoundCompletionInfo(dict):
80
84
  @property
81
85
  def rebase_source_partition_locator(self) -> Optional[PartitionLocator]:
82
86
  return self.get("rebaseSourcePartitionLocator")
87
+
88
+ @property
89
+ def manifest_entry_copied_by_reference_ratio(self) -> Optional[float]:
90
+ return self["manifestEntryCopiedByReferenceRatio"]
@@ -0,0 +1,174 @@
1
+ import ray
2
+ import time
3
+ import logging
4
+ from deltacat import logs
5
+ from deltacat.utils.common import ReadKwargsProvider
6
+ import functools
7
+ import itertools
8
+ from deltacat.compute.compactor import (
9
+ RoundCompletionInfo,
10
+ SortKey,
11
+ )
12
+ from deltacat.types.media import ContentType
13
+ from deltacat.compute.compactor import DeltaAnnotated
14
+ from deltacat.utils.ray_utils.concurrency import (
15
+ invoke_parallel,
16
+ round_robin_options_provider,
17
+ )
18
+
19
+ from deltacat.compute.compactor.model.repartition_result import RepartitionResult
20
+ from deltacat.utils.placement import PlacementGroupConfig
21
+ from typing import List, Optional, Dict, Any
22
+ from deltacat.utils.ray_utils.runtime import live_node_resource_keys
23
+ from deltacat.compute.compactor.utils import io
24
+ from deltacat.compute.compactor.utils import round_completion_file as rcf
25
+ from deltacat.compute.compactor.steps import repartition as repar
26
+ from deltacat.compute.compactor.steps.repartition import RepartitionType
27
+ from deltacat.storage import (
28
+ Delta,
29
+ DeltaLocator,
30
+ PartitionLocator,
31
+ interface as unimplemented_deltacat_storage,
32
+ )
33
+ from deltacat.utils.metrics import MetricsConfig
34
+
35
+ logger = logs.configure_deltacat_logger(logging.getLogger(__name__))
36
+
37
+
38
+ # TODO: move this repartition function to a separate module under compute
39
+ def repartition(
40
+ source_partition_locator: PartitionLocator,
41
+ destination_partition_locator: PartitionLocator,
42
+ repartition_args: Any,
43
+ repartition_completion_file_s3_url: str,
44
+ last_stream_position_to_compact: int,
45
+ repartition_type: RepartitionType = RepartitionType.RANGE,
46
+ sort_keys: List[SortKey] = None,
47
+ records_per_repartitioned_file: int = 4_000_000,
48
+ min_file_count: int = 1000,
49
+ min_delta_bytes: int = 200 * 2**20,
50
+ repartitioned_file_content_type: ContentType = ContentType.PARQUET,
51
+ enable_profiler: bool = False,
52
+ metrics_config: Optional[MetricsConfig] = None,
53
+ pg_config: Optional[PlacementGroupConfig] = None,
54
+ list_deltas_kwargs: Optional[Dict[str, Any]] = None,
55
+ read_kwargs_provider: Optional[ReadKwargsProvider] = None,
56
+ deltacat_storage=unimplemented_deltacat_storage,
57
+ **kwargs,
58
+ ) -> Optional[str]:
59
+
60
+ node_resource_keys = None
61
+ if pg_config: # use resource in each placement group
62
+ cluster_resources = pg_config.resource
63
+ cluster_cpus = cluster_resources["CPU"]
64
+ else: # use all cluster resource
65
+ cluster_resources = ray.cluster_resources()
66
+ logger.info(f"Total cluster resources: {cluster_resources}")
67
+ logger.info(f"Available cluster resources: {ray.available_resources()}")
68
+ cluster_cpus = int(cluster_resources["CPU"])
69
+ logger.info(f"Total cluster CPUs: {cluster_cpus}")
70
+ node_resource_keys = live_node_resource_keys()
71
+ logger.info(
72
+ f"Found {len(node_resource_keys)} live cluster nodes: "
73
+ f"{node_resource_keys}"
74
+ )
75
+
76
+ # create a remote options provider to round-robin tasks across all nodes or allocated bundles
77
+ logger.info(f"Setting round robin scheduling with node id:{node_resource_keys}")
78
+ round_robin_opt_provider = functools.partial(
79
+ round_robin_options_provider,
80
+ resource_keys=node_resource_keys,
81
+ pg_config=pg_config.opts if pg_config else None,
82
+ )
83
+
84
+ deltas = io._discover_deltas(
85
+ source_partition_locator,
86
+ None,
87
+ deltacat_storage.get_partition(
88
+ source_partition_locator.stream_locator,
89
+ source_partition_locator.partition_values,
90
+ ).stream_position,
91
+ deltacat_storage,
92
+ **list_deltas_kwargs,
93
+ )
94
+
95
+ uniform_deltas = []
96
+ for delta in deltas:
97
+ uniform_deltas_part = DeltaAnnotated.rebatch(
98
+ [DeltaAnnotated.of(delta)],
99
+ min_delta_bytes=min_delta_bytes,
100
+ min_file_counts=min_file_count,
101
+ )
102
+ uniform_deltas.extend(uniform_deltas_part)
103
+
104
+ logger.info(f"Retrieved a total of {len(uniform_deltas)} uniform deltas.")
105
+
106
+ max_parallelism = cluster_cpus
107
+ # create a new stream for this round
108
+ compacted_stream_locator = destination_partition_locator.stream_locator
109
+ stream = deltacat_storage.get_stream(
110
+ compacted_stream_locator.namespace,
111
+ compacted_stream_locator.table_name,
112
+ compacted_stream_locator.table_version,
113
+ )
114
+ partition = deltacat_storage.stage_partition(
115
+ stream,
116
+ destination_partition_locator.partition_values,
117
+ )
118
+ new_compacted_partition_locator = partition.locator
119
+ repar_start = time.time()
120
+ repar_tasks_pending = invoke_parallel(
121
+ items=uniform_deltas,
122
+ ray_task=repar.repartition,
123
+ max_parallelism=max_parallelism,
124
+ options_provider=round_robin_opt_provider,
125
+ repartition_type=repartition_type,
126
+ repartition_args=repartition_args,
127
+ max_records_per_output_file=records_per_repartitioned_file,
128
+ destination_partition=partition,
129
+ enable_profiler=enable_profiler,
130
+ metrics_config=metrics_config,
131
+ read_kwargs_provider=read_kwargs_provider,
132
+ repartitioned_file_content_type=repartitioned_file_content_type,
133
+ deltacat_storage=deltacat_storage,
134
+ )
135
+ logger.info(f"Getting {len(repar_tasks_pending)} task results...")
136
+ repar_results: List[RepartitionResult] = ray.get(repar_tasks_pending)
137
+ repar_results: List[Delta] = [rp.range_deltas for rp in repar_results]
138
+ transposed = list(itertools.zip_longest(*repar_results, fillvalue=None))
139
+ ordered_deltas: List[Delta] = [
140
+ i for sublist in transposed for i in sublist if i is not None
141
+ ]
142
+ repar_end = time.time()
143
+ logger.info(f"repartition {repar_end - repar_start} seconds")
144
+ logger.info(f"Got {len(ordered_deltas)} task results.")
145
+ # ordered_deltas are ordered as [cold1, cold2, coldN, hot1, hot2, hotN]
146
+ merged_delta = Delta.merge_deltas(ordered_deltas)
147
+ compacted_delta = deltacat_storage.commit_delta(
148
+ merged_delta, properties=kwargs.get("properties", {})
149
+ )
150
+ deltacat_storage.commit_partition(partition)
151
+ logger.info(f"Committed final delta: {compacted_delta}")
152
+ logger.info(f"Job run completed successfully!")
153
+ new_compacted_delta_locator = DeltaLocator.of(
154
+ new_compacted_partition_locator,
155
+ compacted_delta.stream_position,
156
+ )
157
+ bit_width_of_sort_keys = SortKey.validate_sort_keys(
158
+ source_partition_locator,
159
+ sort_keys,
160
+ deltacat_storage,
161
+ )
162
+ repartition_completion_info = RoundCompletionInfo.of(
163
+ last_stream_position_to_compact,
164
+ new_compacted_delta_locator,
165
+ None,
166
+ bit_width_of_sort_keys,
167
+ None,
168
+ )
169
+ return rcf.write_round_completion_file(
170
+ None,
171
+ None,
172
+ repartition_completion_info,
173
+ repartition_completion_file_s3_url,
174
+ )