Commit 4873b51
authored
Reintroduce translation of identifiers to Protobuf compliant names (#3736)
This reintroduces the work that was reverted (namely #3696 and #3706;
see also #3726). It mainly copies the original PR for the translation
work itself, though it takes a different approach to actually performing
the translation.
Perhaps most notably, this purposefully omits translation of function,
view, and index names--essentially, any item that is not serialized into
a Protobuf identifier is skipped. That means that we only worry about
type (including table, struct, and enum names), enum values, and
struct/table fields.
From an implementation this perspective, this moves the translation of
the names into the areas that are designed to interface between the
`Type` system of the planner and the Protobuf-based system of Record
Layer core. This is then stored in the `Type` information that is
associated with the plan. At the moment, we cheat in a few places and
require that the type's fields are always the result of applying the
translation function to the display name, or vice versa. However, it
allows us to think about allowing custom field names in the future. In a
world where we only use Protobuf for storage but have a different
mechanism for keeping track of fields in the runtime, we'd need a
similar mechanism, though it may take the form of something like a field
name to ordinal position mapping, say.
This borrows and expands the tests from #3696 and #3706. In particular,
it adds additional tests around enums and view and function definitions
with non-compliant names, which now work.1 parent 8f4d50a commit 4873b51
File tree
47 files changed
+3753
-235
lines changed- fdb-record-layer-core/src
- main
- java/com/apple/foundationdb/record
- query/plan/cascades
- predicates
- typing
- values
- simplification
- util
- proto
- test/java/com/apple/foundationdb/record
- provider/foundationdb/query
- query/plan/cascades
- values
- util
- fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/metadata
- fdb-relational-core/src
- main/java/com/apple/foundationdb/relational
- api
- recordlayer
- metadata
- serde
- query
- visitors
- util
- testFixtures/java/com/apple/foundationdb/relational/utils
- test/java/com/apple/foundationdb/relational
- api/ddl
- recordlayer/metadata
- yaml-tests/src
- main/java/com/apple/foundationdb/relational/yamltests
- command
- utils
- test
- java
- proto
- resources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
47 files changed
+3753
-235
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | | - | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
Lines changed: 121 additions & 35 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
287 | | - | |
| 288 | + | |
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| |||
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | | - | |
| 535 | + | |
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | | - | |
554 | | - | |
| 554 | + | |
| 555 | + | |
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
| |||
633 | 634 | | |
634 | 635 | | |
635 | 636 | | |
636 | | - | |
637 | | - | |
638 | | - | |
| 637 | + | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 641 | + | |
645 | 642 | | |
646 | | - | |
| 643 | + | |
647 | 644 | | |
648 | | - | |
649 | 645 | | |
650 | 646 | | |
651 | 647 | | |
652 | 648 | | |
653 | | - | |
| 649 | + | |
654 | 650 | | |
655 | 651 | | |
656 | 652 | | |
657 | 653 | | |
658 | 654 | | |
659 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
660 | 661 | | |
661 | 662 | | |
662 | | - | |
| 663 | + | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
| |||
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
685 | | - | |
| 686 | + | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
692 | | - | |
| 693 | + | |
| 694 | + | |
693 | 695 | | |
694 | | - | |
695 | | - | |
| 696 | + | |
| 697 | + | |
696 | 698 | | |
| 699 | + | |
| 700 | + | |
697 | 701 | | |
698 | 702 | | |
699 | 703 | | |
| |||
706 | 710 | | |
707 | 711 | | |
708 | 712 | | |
709 | | - | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
710 | 725 | | |
711 | 726 | | |
712 | 727 | | |
713 | 728 | | |
714 | | - | |
| 729 | + | |
715 | 730 | | |
716 | 731 | | |
717 | 732 | | |
718 | 733 | | |
719 | | - | |
| 734 | + | |
| 735 | + | |
720 | 736 | | |
721 | 737 | | |
722 | 738 | | |
723 | | - | |
724 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
725 | 744 | | |
726 | 745 | | |
727 | 746 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
| 114 | + | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
37 | 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 | + | |
38 | 83 | | |
39 | 84 | | |
40 | 85 | | |
| |||
103 | 148 | | |
104 | 149 | | |
105 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
106 | 158 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
482 | 486 | | |
483 | 487 | | |
484 | 488 | | |
| 489 | + | |
485 | 490 | | |
486 | 491 | | |
487 | 492 | | |
| |||
0 commit comments