Commit a8e0bdd
committed
Reintroduce translation of identifiers to Protobuf compliant names
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 #3969 and #3706. In particular, it adds additional tests around enums and view and function definitions with non-compliant names, which now work.1 parent f032a91 commit a8e0bdd
File tree
42 files changed
+2924
-201
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/query/plan/cascades
- values
- 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
- 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.
42 files changed
+2924
-201
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: 109 additions & 33 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
554 | | - | |
| 553 | + | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
636 | 640 | | |
637 | 641 | | |
638 | 642 | | |
639 | | - | |
640 | | - | |
641 | 643 | | |
642 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
643 | 648 | | |
644 | | - | |
| 649 | + | |
645 | 650 | | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
649 | 658 | | |
650 | 659 | | |
651 | 660 | | |
652 | 661 | | |
653 | | - | |
| 662 | + | |
654 | 663 | | |
655 | 664 | | |
656 | 665 | | |
657 | 666 | | |
658 | 667 | | |
659 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
660 | 674 | | |
661 | 675 | | |
662 | | - | |
| 676 | + | |
663 | 677 | | |
664 | 678 | | |
665 | 679 | | |
| |||
682 | 696 | | |
683 | 697 | | |
684 | 698 | | |
685 | | - | |
| 699 | + | |
686 | 700 | | |
687 | 701 | | |
688 | 702 | | |
689 | 703 | | |
690 | 704 | | |
691 | 705 | | |
692 | | - | |
| 706 | + | |
693 | 707 | | |
694 | | - | |
695 | | - | |
| 708 | + | |
| 709 | + | |
696 | 710 | | |
697 | 711 | | |
698 | 712 | | |
| |||
706 | 720 | | |
707 | 721 | | |
708 | 722 | | |
709 | | - | |
| 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 | 739 | | |
724 | | - | |
| 740 | + | |
| 741 | + | |
725 | 742 | | |
726 | 743 | | |
727 | 744 | | |
| |||
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: 4 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 | | |
| |||
0 commit comments