-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathpg_catalog.rs
More file actions
2085 lines (1949 loc) · 73.4 KB
/
pg_catalog.rs
File metadata and controls
2085 lines (1949 loc) · 73.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::atomic::AtomicU32;
use async_trait::async_trait;
use datafusion::arrow::array::{
ArrayRef, AsArray, BooleanArray, BooleanBuilder, Int32Builder, RecordBatch, StringArray,
StringBuilder, as_boolean_array,
};
use datafusion::arrow::datatypes::{DataType, Field, Int32Type, SchemaRef};
use datafusion::arrow::ipc::reader::FileReader;
use datafusion::catalog::streaming::StreamingTable;
use datafusion::catalog::{MemTable, SchemaProvider, TableFunctionImpl};
use datafusion::common::utils::SingleRowListArrayBuilder;
use datafusion::datasource::TableProvider;
use datafusion::error::{DataFusionError, Result};
use datafusion::logical_expr::{
ColumnarValue, ScalarUDF, ScalarUDFImpl, Signature, TypeSignature, Volatility,
};
use datafusion::physical_plan::streaming::PartitionStream;
use datafusion::prelude::{Expr, SessionContext, create_udf};
use postgres_types::Oid;
use tokio::sync::RwLock;
use crate::pg_catalog::catalog_info::CatalogInfo;
use crate::pg_catalog::context::PgCatalogContextProvider;
use crate::pg_catalog::empty_table::EmptyTable;
pub mod catalog_info;
pub mod context;
pub mod empty_table;
pub mod format_type;
pub mod has_privilege_udf;
pub mod pg_attribute;
pub mod pg_class;
pub mod pg_database;
pub mod pg_get_expr_udf;
pub mod pg_locks;
pub mod pg_namespace;
pub mod pg_replication_slot;
pub mod pg_roles;
pub mod pg_settings;
pub mod pg_stat_gssapi;
pub mod pg_stat_ssl;
pub mod pg_tables;
pub mod pg_tablespace;
pub mod pg_timezone;
pub mod pg_views;
pub mod quote_ident_udf;
const PG_CATALOG_TABLE_PG_AGGREGATE: &str = "pg_aggregate";
const PG_CATALOG_TABLE_PG_AM: &str = "pg_am";
const PG_CATALOG_TABLE_PG_AMOP: &str = "pg_amop";
const PG_CATALOG_TABLE_PG_AMPROC: &str = "pg_amproc";
const PG_CATALOG_TABLE_PG_CAST: &str = "pg_cast";
const PG_CATALOG_TABLE_PG_COLLATION: &str = "pg_collation";
const PG_CATALOG_TABLE_PG_CONVERSION: &str = "pg_conversion";
const PG_CATALOG_TABLE_PG_LANGUAGE: &str = "pg_language";
const PG_CATALOG_TABLE_PG_OPCLASS: &str = "pg_opclass";
const PG_CATALOG_TABLE_PG_OPERATOR: &str = "pg_operator";
const PG_CATALOG_TABLE_PG_OPFAMILY: &str = "pg_opfamily";
const PG_CATALOG_TABLE_PG_PROC: &str = "pg_proc";
const PG_CATALOG_TABLE_PG_RANGE: &str = "pg_range";
const PG_CATALOG_TABLE_PG_TS_CONFIG: &str = "pg_ts_config";
const PG_CATALOG_TABLE_PG_TS_DICT: &str = "pg_ts_dict";
const PG_CATALOG_TABLE_PG_TS_PARSER: &str = "pg_ts_parser";
const PG_CATALOG_TABLE_PG_TS_TEMPLATE: &str = "pg_ts_template";
const PG_CATALOG_TABLE_PG_TYPE: &str = "pg_type";
const PG_CATALOG_TABLE_PG_ATTRIBUTE: &str = "pg_attribute";
const PG_CATALOG_TABLE_PG_ATTRDEF: &str = "pg_attrdef";
const PG_CATALOG_TABLE_PG_AUTH_MEMBERS: &str = "pg_auth_members";
const PG_CATALOG_TABLE_PG_AUTHID: &str = "pg_authid";
const PG_CATALOG_TABLE_PG_CLASS: &str = "pg_class";
const PG_CATALOG_TABLE_PG_CONSTRAINT: &str = "pg_constraint";
const PG_CATALOG_TABLE_PG_DATABASE: &str = "pg_database";
const PG_CATALOG_TABLE_PG_DB_ROLE_SETTING: &str = "pg_db_role_setting";
const PG_CATALOG_TABLE_PG_DEFAULT_ACL: &str = "pg_default_acl";
const PG_CATALOG_TABLE_PG_DEPEND: &str = "pg_depend";
const PG_CATALOG_TABLE_PG_DESCRIPTION: &str = "pg_description";
const PG_CATALOG_TABLE_PG_ENUM: &str = "pg_enum";
const PG_CATALOG_TABLE_PG_EVENT_TRIGGER: &str = "pg_event_trigger";
const PG_CATALOG_TABLE_PG_EXTENSION: &str = "pg_extension";
const PG_CATALOG_TABLE_PG_FOREIGN_DATA_WRAPPER: &str = "pg_foreign_data_wrapper";
const PG_CATALOG_TABLE_PG_FOREIGN_SERVER: &str = "pg_foreign_server";
const PG_CATALOG_TABLE_PG_FOREIGN_TABLE: &str = "pg_foreign_table";
const PG_CATALOG_TABLE_PG_INDEX: &str = "pg_index";
const PG_CATALOG_TABLE_PG_INHERITS: &str = "pg_inherits";
const PG_CATALOG_TABLE_PG_INIT_PRIVS: &str = "pg_init_privs";
const PG_CATALOG_TABLE_PG_LARGEOBJECT: &str = "pg_largeobject";
const PG_CATALOG_TABLE_PG_LARGEOBJECT_METADATA: &str = "pg_largeobject_metadata";
const PG_CATALOG_TABLE_PG_NAMESPACE: &str = "pg_namespace";
const PG_CATALOG_TABLE_PG_PARTITIONED_TABLE: &str = "pg_partitioned_table";
const PG_CATALOG_TABLE_PG_POLICY: &str = "pg_policy";
const PG_CATALOG_TABLE_PG_PUBLICATION: &str = "pg_publication";
const PG_CATALOG_TABLE_PG_PUBLICATION_NAMESPACE: &str = "pg_publication_namespace";
const PG_CATALOG_TABLE_PG_PUBLICATION_REL: &str = "pg_publication_rel";
const PG_CATALOG_TABLE_PG_REPLICATION_ORIGIN: &str = "pg_replication_origin";
const PG_CATALOG_TABLE_PG_REWRITE: &str = "pg_rewrite";
const PG_CATALOG_TABLE_PG_SECLABEL: &str = "pg_seclabel";
const PG_CATALOG_TABLE_PG_SEQUENCE: &str = "pg_sequence";
const PG_CATALOG_TABLE_PG_SHDEPEND: &str = "pg_shdepend";
const PG_CATALOG_TABLE_PG_SHDESCRIPTION: &str = "pg_shdescription";
const PG_CATALOG_TABLE_PG_SHSECLABEL: &str = "pg_shseclabel";
const PG_CATALOG_TABLE_PG_STATISTIC: &str = "pg_statistic";
const PG_CATALOG_TABLE_PG_STATISTIC_EXT: &str = "pg_statistic_ext";
const PG_CATALOG_TABLE_PG_STATISTIC_EXT_DATA: &str = "pg_statistic_ext_data";
const PG_CATALOG_TABLE_PG_SUBSCRIPTION: &str = "pg_subscription";
const PG_CATALOG_TABLE_PG_SUBSCRIPTION_REL: &str = "pg_subscription_rel";
const PG_CATALOG_TABLE_PG_TABLESPACE: &str = "pg_tablespace";
const PG_CATALOG_TABLE_PG_LOCKS: &str = "pg_locks";
const PG_CATALOG_VIEW_PG_TIMEZONE_NAMES: &str = "pg_timezone_names";
const PG_CATALOG_VIEW_PG_TIMEZONE_ABBREVS: &str = "pg_timezone_abbrevs";
const PG_CATALOG_TABLE_PG_TRIGGER: &str = "pg_trigger";
const PG_CATALOG_TABLE_PG_USER_MAPPING: &str = "pg_user_mapping";
const PG_CATALOG_VIEW_PG_SETTINGS: &str = "pg_settings";
const PG_CATALOG_VIEW_PG_VIEWS: &str = "pg_views";
const PG_CATALOG_VIEW_PG_MATVIEWS: &str = "pg_matviews";
const PG_CATALOG_VIEW_PG_ROLES: &str = "pg_roles";
const PG_CATALOG_VIEW_PG_TABLES: &str = "pg_tables";
const PG_CATALOG_VIEW_PG_STAT_GSSAPI: &str = "pg_stat_gssapi";
const PG_CATALOG_VIEW_PG_STAT_SSL: &str = "pg_stat_ssl";
const PG_CATALOG_VIEW_PG_STAT_USER_TABLES: &str = "pg_stat_user_tables";
const PG_CATALOG_VIEW_PG_REPLICATION_SLOTS: &str = "pg_replication_slots";
pub const PG_CATALOG_TABLES: &[&str] = &[
PG_CATALOG_TABLE_PG_AGGREGATE,
PG_CATALOG_TABLE_PG_AM,
PG_CATALOG_TABLE_PG_AMOP,
PG_CATALOG_TABLE_PG_AMPROC,
PG_CATALOG_TABLE_PG_CAST,
PG_CATALOG_TABLE_PG_COLLATION,
PG_CATALOG_TABLE_PG_CONVERSION,
PG_CATALOG_TABLE_PG_LANGUAGE,
PG_CATALOG_TABLE_PG_OPCLASS,
PG_CATALOG_TABLE_PG_OPERATOR,
PG_CATALOG_TABLE_PG_OPFAMILY,
PG_CATALOG_TABLE_PG_PROC,
PG_CATALOG_TABLE_PG_RANGE,
PG_CATALOG_TABLE_PG_TS_CONFIG,
PG_CATALOG_TABLE_PG_TS_DICT,
PG_CATALOG_TABLE_PG_TS_PARSER,
PG_CATALOG_TABLE_PG_TS_TEMPLATE,
PG_CATALOG_TABLE_PG_TYPE,
PG_CATALOG_TABLE_PG_ATTRIBUTE,
PG_CATALOG_TABLE_PG_ATTRDEF,
PG_CATALOG_TABLE_PG_AUTH_MEMBERS,
PG_CATALOG_TABLE_PG_AUTHID,
PG_CATALOG_TABLE_PG_CLASS,
PG_CATALOG_TABLE_PG_CONSTRAINT,
PG_CATALOG_TABLE_PG_DATABASE,
PG_CATALOG_TABLE_PG_DB_ROLE_SETTING,
PG_CATALOG_TABLE_PG_DEFAULT_ACL,
PG_CATALOG_TABLE_PG_DEPEND,
PG_CATALOG_TABLE_PG_DESCRIPTION,
PG_CATALOG_TABLE_PG_ENUM,
PG_CATALOG_TABLE_PG_EVENT_TRIGGER,
PG_CATALOG_TABLE_PG_EXTENSION,
PG_CATALOG_TABLE_PG_FOREIGN_DATA_WRAPPER,
PG_CATALOG_TABLE_PG_FOREIGN_SERVER,
PG_CATALOG_TABLE_PG_FOREIGN_TABLE,
PG_CATALOG_TABLE_PG_INDEX,
PG_CATALOG_TABLE_PG_INHERITS,
PG_CATALOG_TABLE_PG_INIT_PRIVS,
PG_CATALOG_TABLE_PG_LARGEOBJECT,
PG_CATALOG_TABLE_PG_LARGEOBJECT_METADATA,
PG_CATALOG_TABLE_PG_NAMESPACE,
PG_CATALOG_TABLE_PG_PARTITIONED_TABLE,
PG_CATALOG_TABLE_PG_POLICY,
PG_CATALOG_TABLE_PG_PUBLICATION,
PG_CATALOG_TABLE_PG_PUBLICATION_NAMESPACE,
PG_CATALOG_TABLE_PG_PUBLICATION_REL,
PG_CATALOG_TABLE_PG_REPLICATION_ORIGIN,
PG_CATALOG_TABLE_PG_REWRITE,
PG_CATALOG_TABLE_PG_SECLABEL,
PG_CATALOG_TABLE_PG_SEQUENCE,
PG_CATALOG_TABLE_PG_SHDEPEND,
PG_CATALOG_TABLE_PG_SHDESCRIPTION,
PG_CATALOG_TABLE_PG_SHSECLABEL,
PG_CATALOG_TABLE_PG_STATISTIC,
PG_CATALOG_TABLE_PG_STATISTIC_EXT,
PG_CATALOG_TABLE_PG_STATISTIC_EXT_DATA,
PG_CATALOG_TABLE_PG_SUBSCRIPTION,
PG_CATALOG_TABLE_PG_SUBSCRIPTION_REL,
PG_CATALOG_TABLE_PG_TABLESPACE,
PG_CATALOG_TABLE_PG_LOCKS,
PG_CATALOG_TABLE_PG_TRIGGER,
PG_CATALOG_TABLE_PG_USER_MAPPING,
PG_CATALOG_VIEW_PG_ROLES,
PG_CATALOG_VIEW_PG_SETTINGS,
PG_CATALOG_VIEW_PG_STAT_GSSAPI,
PG_CATALOG_VIEW_PG_STAT_SSL,
PG_CATALOG_VIEW_PG_TABLES,
PG_CATALOG_VIEW_PG_VIEWS,
PG_CATALOG_VIEW_PG_MATVIEWS,
PG_CATALOG_VIEW_PG_STAT_USER_TABLES,
PG_CATALOG_VIEW_PG_REPLICATION_SLOTS,
PG_CATALOG_VIEW_PG_TIMEZONE_NAMES,
PG_CATALOG_VIEW_PG_TIMEZONE_ABBREVS,
];
#[derive(Debug, Hash, Eq, PartialEq, PartialOrd, Ord)]
pub(crate) enum OidCacheKey {
Catalog(String),
Schema(String, String),
/// Table by schema and table name
Table(String, String, String),
}
// Create custom schema provider for pg_catalog
#[derive(Debug)]
pub struct PgCatalogSchemaProvider<C, P> {
catalog_list: C,
oid_counter: Arc<AtomicU32>,
oid_cache: Arc<RwLock<HashMap<OidCacheKey, Oid>>>,
static_tables: Arc<PgCatalogStaticTables>,
context_provider: P,
}
#[async_trait]
impl<C: CatalogInfo, P: PgCatalogContextProvider> SchemaProvider for PgCatalogSchemaProvider<C, P> {
fn as_any(&self) -> &dyn std::any::Any {
self
}
fn table_names(&self) -> Vec<String> {
PG_CATALOG_TABLES.iter().map(ToString::to_string).collect()
}
async fn table(&self, name: &str) -> Result<Option<Arc<dyn TableProvider>>> {
if let Some(table) = self.build_table_by_name(name)? {
let table_provider = table.try_into_table_provider()?;
Ok(Some(table_provider))
} else {
Ok(None)
}
}
fn table_exist(&self, name: &str) -> bool {
PG_CATALOG_TABLES.contains(&name.to_ascii_lowercase().as_str())
}
}
impl<C: CatalogInfo, P: PgCatalogContextProvider> PgCatalogSchemaProvider<C, P> {
pub fn try_new(
catalog_list: C,
static_tables: Arc<PgCatalogStaticTables>,
context_provider: P,
) -> Result<PgCatalogSchemaProvider<C, P>> {
Ok(Self {
catalog_list,
oid_counter: Arc::new(AtomicU32::new(16384)),
oid_cache: Arc::new(RwLock::new(HashMap::new())),
static_tables,
context_provider,
})
}
pub fn build_table_by_name(&self, name: &str) -> Result<Option<PgCatalogTable>> {
match name.to_ascii_lowercase().as_str() {
PG_CATALOG_TABLE_PG_AGGREGATE => {
Ok(Some(self.static_tables.pg_aggregate.clone().into()))
}
PG_CATALOG_TABLE_PG_AM => Ok(Some(self.static_tables.pg_am.clone().into())),
PG_CATALOG_TABLE_PG_AMOP => Ok(Some(self.static_tables.pg_amop.clone().into())),
PG_CATALOG_TABLE_PG_AMPROC => Ok(Some(self.static_tables.pg_amproc.clone().into())),
PG_CATALOG_TABLE_PG_CAST => Ok(Some(self.static_tables.pg_cast.clone().into())),
PG_CATALOG_TABLE_PG_COLLATION => {
Ok(Some(self.static_tables.pg_collation.clone().into()))
}
PG_CATALOG_TABLE_PG_CONVERSION => {
Ok(Some(self.static_tables.pg_conversion.clone().into()))
}
PG_CATALOG_TABLE_PG_LANGUAGE => Ok(Some(self.static_tables.pg_language.clone().into())),
PG_CATALOG_TABLE_PG_OPCLASS => Ok(Some(self.static_tables.pg_opclass.clone().into())),
PG_CATALOG_TABLE_PG_OPERATOR => Ok(Some(self.static_tables.pg_operator.clone().into())),
PG_CATALOG_TABLE_PG_OPFAMILY => Ok(Some(self.static_tables.pg_opfamily.clone().into())),
PG_CATALOG_TABLE_PG_PROC => Ok(Some(self.static_tables.pg_proc.clone().into())),
PG_CATALOG_TABLE_PG_RANGE => Ok(Some(self.static_tables.pg_range.clone().into())),
PG_CATALOG_TABLE_PG_TS_CONFIG => {
Ok(Some(self.static_tables.pg_ts_config.clone().into()))
}
PG_CATALOG_TABLE_PG_TS_DICT => Ok(Some(self.static_tables.pg_ts_dict.clone().into())),
PG_CATALOG_TABLE_PG_TS_PARSER => {
Ok(Some(self.static_tables.pg_ts_parser.clone().into()))
}
PG_CATALOG_TABLE_PG_TS_TEMPLATE => {
Ok(Some(self.static_tables.pg_ts_template.clone().into()))
}
PG_CATALOG_TABLE_PG_TYPE => Ok(Some(self.static_tables.pg_type.clone().into())),
PG_CATALOG_TABLE_PG_ATTRDEF => Ok(Some(self.static_tables.pg_attrdef.clone().into())),
PG_CATALOG_TABLE_PG_AUTH_MEMBERS => {
Ok(Some(self.static_tables.pg_auth_members.clone().into()))
}
PG_CATALOG_TABLE_PG_AUTHID => Ok(Some(self.static_tables.pg_authid.clone().into())),
PG_CATALOG_TABLE_PG_CONSTRAINT => {
Ok(Some(self.static_tables.pg_constraint.clone().into()))
}
PG_CATALOG_TABLE_PG_DB_ROLE_SETTING => {
Ok(Some(self.static_tables.pg_db_role_setting.clone().into()))
}
PG_CATALOG_TABLE_PG_DEFAULT_ACL => {
Ok(Some(self.static_tables.pg_default_acl.clone().into()))
}
PG_CATALOG_TABLE_PG_DEPEND => Ok(Some(self.static_tables.pg_depend.clone().into())),
PG_CATALOG_TABLE_PG_DESCRIPTION => {
Ok(Some(self.static_tables.pg_description.clone().into()))
}
PG_CATALOG_TABLE_PG_ENUM => Ok(Some(self.static_tables.pg_enum.clone().into())),
PG_CATALOG_TABLE_PG_EVENT_TRIGGER => {
Ok(Some(self.static_tables.pg_event_trigger.clone().into()))
}
PG_CATALOG_TABLE_PG_EXTENSION => {
Ok(Some(self.static_tables.pg_extension.clone().into()))
}
PG_CATALOG_TABLE_PG_FOREIGN_DATA_WRAPPER => Ok(Some(
self.static_tables.pg_foreign_data_wrapper.clone().into(),
)),
PG_CATALOG_TABLE_PG_FOREIGN_SERVER => {
Ok(Some(self.static_tables.pg_foreign_server.clone().into()))
}
PG_CATALOG_TABLE_PG_FOREIGN_TABLE => {
Ok(Some(self.static_tables.pg_foreign_table.clone().into()))
}
PG_CATALOG_TABLE_PG_INDEX => Ok(Some(self.static_tables.pg_index.clone().into())),
PG_CATALOG_TABLE_PG_INHERITS => Ok(Some(self.static_tables.pg_inherits.clone().into())),
PG_CATALOG_TABLE_PG_INIT_PRIVS => {
Ok(Some(self.static_tables.pg_init_privs.clone().into()))
}
PG_CATALOG_TABLE_PG_LARGEOBJECT => {
Ok(Some(self.static_tables.pg_largeobject.clone().into()))
}
PG_CATALOG_TABLE_PG_LARGEOBJECT_METADATA => Ok(Some(
self.static_tables.pg_largeobject_metadata.clone().into(),
)),
PG_CATALOG_TABLE_PG_PARTITIONED_TABLE => {
Ok(Some(self.static_tables.pg_partitioned_table.clone().into()))
}
PG_CATALOG_TABLE_PG_POLICY => Ok(Some(self.static_tables.pg_policy.clone().into())),
PG_CATALOG_TABLE_PG_PUBLICATION => {
Ok(Some(self.static_tables.pg_publication.clone().into()))
}
PG_CATALOG_TABLE_PG_PUBLICATION_NAMESPACE => Ok(Some(
self.static_tables.pg_publication_namespace.clone().into(),
)),
PG_CATALOG_TABLE_PG_PUBLICATION_REL => {
Ok(Some(self.static_tables.pg_publication_rel.clone().into()))
}
PG_CATALOG_TABLE_PG_REPLICATION_ORIGIN => Ok(Some(
self.static_tables.pg_replication_origin.clone().into(),
)),
PG_CATALOG_TABLE_PG_REWRITE => Ok(Some(self.static_tables.pg_rewrite.clone().into())),
PG_CATALOG_TABLE_PG_SECLABEL => Ok(Some(self.static_tables.pg_seclabel.clone().into())),
PG_CATALOG_TABLE_PG_SEQUENCE => Ok(Some(self.static_tables.pg_sequence.clone().into())),
PG_CATALOG_TABLE_PG_SHDEPEND => Ok(Some(self.static_tables.pg_shdepend.clone().into())),
PG_CATALOG_TABLE_PG_SHDESCRIPTION => {
Ok(Some(self.static_tables.pg_shdescription.clone().into()))
}
PG_CATALOG_TABLE_PG_SHSECLABEL => {
Ok(Some(self.static_tables.pg_shseclabel.clone().into()))
}
PG_CATALOG_TABLE_PG_STATISTIC => {
Ok(Some(self.static_tables.pg_statistic.clone().into()))
}
PG_CATALOG_TABLE_PG_STATISTIC_EXT => {
Ok(Some(self.static_tables.pg_statistic_ext.clone().into()))
}
PG_CATALOG_TABLE_PG_STATISTIC_EXT_DATA => Ok(Some(
self.static_tables.pg_statistic_ext_data.clone().into(),
)),
PG_CATALOG_TABLE_PG_SUBSCRIPTION => {
Ok(Some(self.static_tables.pg_subscription.clone().into()))
}
PG_CATALOG_TABLE_PG_SUBSCRIPTION_REL => {
Ok(Some(self.static_tables.pg_subscription_rel.clone().into()))
}
PG_CATALOG_TABLE_PG_TABLESPACE => {
let table = Arc::new(pg_tablespace::PgTablespaceTable::new());
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_TABLE_PG_TRIGGER => Ok(Some(self.static_tables.pg_trigger.clone().into())),
PG_CATALOG_TABLE_PG_USER_MAPPING => {
Ok(Some(self.static_tables.pg_user_mapping.clone().into()))
}
PG_CATALOG_TABLE_PG_ATTRIBUTE => {
let table = Arc::new(pg_attribute::PgAttributeTable::new(
self.catalog_list.clone(),
self.oid_counter.clone(),
self.oid_cache.clone(),
));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_TABLE_PG_CLASS => {
let table = Arc::new(pg_class::PgClassTable::new(
self.catalog_list.clone(),
self.oid_counter.clone(),
self.oid_cache.clone(),
));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_TABLE_PG_DATABASE => {
let table = Arc::new(pg_database::PgDatabaseTable::new(
self.catalog_list.clone(),
self.oid_counter.clone(),
self.oid_cache.clone(),
));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_TABLE_PG_NAMESPACE => {
let table = Arc::new(pg_namespace::PgNamespaceTable::new(
self.catalog_list.clone(),
self.oid_counter.clone(),
self.oid_cache.clone(),
));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_TABLES => {
let table = Arc::new(pg_tables::PgTablesTable::new(self.catalog_list.clone()));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_SETTINGS => {
let table = Arc::new(pg_settings::PgSettingsView::new());
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_STAT_GSSAPI => {
let table = Arc::new(pg_stat_gssapi::PgStatGssApiTable::new());
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_STAT_SSL => {
let table = Arc::new(pg_stat_ssl::PgStatSslTable::new());
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_ROLES => {
let table = Arc::new(pg_roles::PgRolesTable::new(self.context_provider.clone()));
Ok(Some(PgCatalogTable::Dynamic(table)))
}
PG_CATALOG_VIEW_PG_VIEWS => Ok(Some(pg_views::pg_views().into())),
PG_CATALOG_VIEW_PG_MATVIEWS => Ok(Some(pg_views::pg_matviews().into())),
PG_CATALOG_VIEW_PG_STAT_USER_TABLES => Ok(Some(pg_views::pg_stat_user_tables().into())),
PG_CATALOG_VIEW_PG_REPLICATION_SLOTS => {
Ok(Some(pg_replication_slot::pg_replication_slots().into()))
}
PG_CATALOG_TABLE_PG_LOCKS => Ok(Some(pg_locks::pg_locks().into())),
PG_CATALOG_VIEW_PG_TIMEZONE_NAMES => Ok(Some(pg_timezone::pg_timezone_names().into())),
PG_CATALOG_VIEW_PG_TIMEZONE_ABBREVS => {
Ok(Some(pg_timezone::pg_timezone_abbrevs().into()))
}
_ => Ok(None),
}
}
}
/// A table that reads data from Avro bytes
#[derive(Debug, Clone)]
pub struct ArrowTable {
schema: SchemaRef,
data: Vec<RecordBatch>,
}
impl ArrowTable {
/// Create a new ArrowTable from bytes
pub fn from_ipc_data(data: Vec<u8>) -> Result<Self> {
let cursor = std::io::Cursor::new(data);
let reader = FileReader::try_new(cursor, None)?;
let schema = reader.schema();
let mut batches = Vec::new();
// Read all record batches from the IPC stream
for batch in reader {
batches.push(batch?);
}
Ok(Self {
schema,
data: batches,
})
}
/// Convert the arrow data into datafusion MemTable
pub fn try_into_memtable(&self) -> Result<Arc<MemTable>> {
let mem_table = MemTable::try_new(self.schema.clone(), vec![self.data.clone()])?;
Ok(Arc::new(mem_table))
}
pub fn data(&self) -> &[RecordBatch] {
&self.data
}
pub fn schema(&self) -> SchemaRef {
self.schema.clone()
}
}
impl TableFunctionImpl for ArrowTable {
fn call(&self, _args: &[Expr]) -> Result<Arc<dyn TableProvider>> {
let table = self.try_into_memtable()?;
Ok(table)
}
}
/// an enum to wrap all kinds of tables
pub enum PgCatalogTable {
Static(Arc<ArrowTable>),
Dynamic(Arc<dyn PartitionStream>),
Empty(EmptyTable),
}
impl From<Arc<ArrowTable>> for PgCatalogTable {
fn from(t: Arc<ArrowTable>) -> PgCatalogTable {
PgCatalogTable::Static(t)
}
}
impl From<EmptyTable> for PgCatalogTable {
fn from(t: EmptyTable) -> PgCatalogTable {
Self::Empty(t)
}
}
impl PgCatalogTable {
pub fn try_into_table_provider(&self) -> Result<Arc<dyn TableProvider>> {
match self {
Self::Static(t) => {
let memtable = t.try_into_memtable()?;
Ok(memtable)
}
Self::Dynamic(t) => {
let streaming_table =
StreamingTable::try_new(Arc::clone(t.schema()), vec![t.clone()])?;
Ok(Arc::new(streaming_table))
}
Self::Empty(t) => {
let memtable = t.try_into_memtable()?;
Ok(memtable)
}
}
}
pub fn schema(&self) -> SchemaRef {
match self {
Self::Static(t) => t.schema(),
Self::Dynamic(t) => t.schema().clone(),
Self::Empty(t) => t.schema(),
}
}
}
/// pg_catalog table as datafusion table provider
///
/// This implementation only contains static tables
#[derive(Debug, Clone)]
pub struct PgCatalogStaticTables {
pub pg_aggregate: Arc<ArrowTable>,
pub pg_am: Arc<ArrowTable>,
pub pg_amop: Arc<ArrowTable>,
pub pg_amproc: Arc<ArrowTable>,
pub pg_cast: Arc<ArrowTable>,
pub pg_collation: Arc<ArrowTable>,
pub pg_conversion: Arc<ArrowTable>,
pub pg_language: Arc<ArrowTable>,
pub pg_opclass: Arc<ArrowTable>,
pub pg_operator: Arc<ArrowTable>,
pub pg_opfamily: Arc<ArrowTable>,
pub pg_proc: Arc<ArrowTable>,
pub pg_range: Arc<ArrowTable>,
pub pg_ts_config: Arc<ArrowTable>,
pub pg_ts_dict: Arc<ArrowTable>,
pub pg_ts_parser: Arc<ArrowTable>,
pub pg_ts_template: Arc<ArrowTable>,
pub pg_type: Arc<ArrowTable>,
pub pg_attrdef: Arc<ArrowTable>,
pub pg_auth_members: Arc<ArrowTable>,
pub pg_authid: Arc<ArrowTable>,
pub pg_constraint: Arc<ArrowTable>,
pub pg_db_role_setting: Arc<ArrowTable>,
pub pg_default_acl: Arc<ArrowTable>,
pub pg_depend: Arc<ArrowTable>,
pub pg_description: Arc<ArrowTable>,
pub pg_enum: Arc<ArrowTable>,
pub pg_event_trigger: Arc<ArrowTable>,
pub pg_extension: Arc<ArrowTable>,
pub pg_foreign_data_wrapper: Arc<ArrowTable>,
pub pg_foreign_server: Arc<ArrowTable>,
pub pg_foreign_table: Arc<ArrowTable>,
pub pg_index: Arc<ArrowTable>,
pub pg_inherits: Arc<ArrowTable>,
pub pg_init_privs: Arc<ArrowTable>,
pub pg_largeobject: Arc<ArrowTable>,
pub pg_largeobject_metadata: Arc<ArrowTable>,
pub pg_partitioned_table: Arc<ArrowTable>,
pub pg_policy: Arc<ArrowTable>,
pub pg_publication: Arc<ArrowTable>,
pub pg_publication_namespace: Arc<ArrowTable>,
pub pg_publication_rel: Arc<ArrowTable>,
pub pg_replication_origin: Arc<ArrowTable>,
pub pg_rewrite: Arc<ArrowTable>,
pub pg_seclabel: Arc<ArrowTable>,
pub pg_sequence: Arc<ArrowTable>,
pub pg_shdepend: Arc<ArrowTable>,
pub pg_shdescription: Arc<ArrowTable>,
pub pg_shseclabel: Arc<ArrowTable>,
pub pg_statistic: Arc<ArrowTable>,
pub pg_statistic_ext: Arc<ArrowTable>,
pub pg_statistic_ext_data: Arc<ArrowTable>,
pub pg_subscription: Arc<ArrowTable>,
pub pg_subscription_rel: Arc<ArrowTable>,
pub pg_trigger: Arc<ArrowTable>,
pub pg_user_mapping: Arc<ArrowTable>,
pub pg_get_keywords: Arc<ArrowTable>,
}
impl PgCatalogStaticTables {
pub fn try_new() -> Result<Self> {
Ok(Self {
pg_aggregate: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_aggregate.feather"
))
.to_vec(),
)?,
pg_am: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_am.feather"
))
.to_vec(),
)?,
pg_amop: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_amop.feather"
))
.to_vec(),
)?,
pg_amproc: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_amproc.feather"
))
.to_vec(),
)?,
pg_cast: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_cast.feather"
))
.to_vec(),
)?,
pg_collation: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_collation.feather"
))
.to_vec(),
)?,
pg_conversion: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_conversion.feather"
))
.to_vec(),
)?,
pg_language: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_language.feather"
))
.to_vec(),
)?,
pg_opclass: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_opclass.feather"
))
.to_vec(),
)?,
pg_operator: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_operator.feather"
))
.to_vec(),
)?,
pg_opfamily: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_opfamily.feather"
))
.to_vec(),
)?,
pg_proc: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_proc.feather"
))
.to_vec(),
)?,
pg_range: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_range.feather"
))
.to_vec(),
)?,
pg_ts_config: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_ts_config.feather"
))
.to_vec(),
)?,
pg_ts_dict: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_ts_dict.feather"
))
.to_vec(),
)?,
pg_ts_parser: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_ts_parser.feather"
))
.to_vec(),
)?,
pg_ts_template: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_ts_template.feather"
))
.to_vec(),
)?,
pg_type: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_type.feather"
))
.to_vec(),
)?,
pg_attrdef: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_attrdef.feather"
))
.to_vec(),
)?,
pg_auth_members: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_auth_members.feather"
))
.to_vec(),
)?,
pg_authid: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_authid.feather"
))
.to_vec(),
)?,
pg_constraint: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_constraint.feather"
))
.to_vec(),
)?,
pg_db_role_setting: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_db_role_setting.feather"
))
.to_vec(),
)?,
pg_default_acl: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_default_acl.feather"
))
.to_vec(),
)?,
pg_depend: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_depend.feather"
))
.to_vec(),
)?,
pg_description: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_description.feather"
))
.to_vec(),
)?,
pg_enum: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_enum.feather"
))
.to_vec(),
)?,
pg_event_trigger: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_event_trigger.feather"
))
.to_vec(),
)?,
pg_extension: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_extension.feather"
))
.to_vec(),
)?,
pg_foreign_data_wrapper: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_foreign_data_wrapper.feather"
))
.to_vec(),
)?,
pg_foreign_server: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_foreign_server.feather"
))
.to_vec(),
)?,
pg_foreign_table: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_foreign_table.feather"
))
.to_vec(),
)?,
pg_index: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_index.feather"
))
.to_vec(),
)?,
pg_inherits: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_inherits.feather"
))
.to_vec(),
)?,
pg_init_privs: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_init_privs.feather"
))
.to_vec(),
)?,
pg_largeobject: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_largeobject.feather"
))
.to_vec(),
)?,
pg_largeobject_metadata: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_largeobject_metadata.feather"
))
.to_vec(),
)?,
pg_partitioned_table: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_partitioned_table.feather"
))
.to_vec(),
)?,
pg_policy: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_policy.feather"
))
.to_vec(),
)?,
pg_publication: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_publication.feather"
))
.to_vec(),
)?,
pg_publication_namespace: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_publication_namespace.feather"
))
.to_vec(),
)?,
pg_publication_rel: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_publication_rel.feather"
))
.to_vec(),
)?,
pg_replication_origin: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_replication_origin.feather"
))
.to_vec(),
)?,
pg_rewrite: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_rewrite.feather"
))
.to_vec(),
)?,
pg_seclabel: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_seclabel.feather"
))
.to_vec(),
)?,
pg_sequence: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_sequence.feather"
))
.to_vec(),
)?,
pg_shdepend: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_shdepend.feather"
))
.to_vec(),
)?,
pg_shdescription: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_shdescription.feather"
))
.to_vec(),
)?,
pg_shseclabel: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_shseclabel.feather"
))
.to_vec(),
)?,
pg_statistic: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_statistic.feather"
))
.to_vec(),
)?,
pg_statistic_ext: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_statistic_ext.feather"
))
.to_vec(),
)?,
pg_statistic_ext_data: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_statistic_ext_data.feather"
))
.to_vec(),
)?,
pg_subscription: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_subscription.feather"
))
.to_vec(),
)?,
pg_subscription_rel: Self::create_arrow_table(
include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/pg_catalog_arrow_exports/pg_subscription_rel.feather"
))
.to_vec(),
)?,