-
Notifications
You must be signed in to change notification settings - Fork 110
Support UDF in plan generator #3040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pengpeng-lu
wants to merge
80
commits into
FoundationDB:main
Choose a base branch
from
pengpeng-lu:udo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 71 commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
3a5a44b
save
pengpeng-lu 53416bf
Revert "save"
pengpeng-lu 3f88bb4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 773e0dd
Merge remote-tracking branch 'upstream/main'
pengpeng-lu fa472d7
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 4c32432
Merge remote-tracking branch 'upstream/main'
pengpeng-lu ccd8e8d
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 403a4a2
Merge remote-tracking branch 'upstream/main'
pengpeng-lu cada59a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 3b02019
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 138a7fc
Merge remote-tracking branch 'upstream/main'
pengpeng-lu f8b3658
Merge branch 'main' of github.com:pengpeng-lu/fdb-record-layer
pengpeng-lu b4edc0a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu c42c0ce
Merge remote-tracking branch 'upstream/main'
pengpeng-lu a570479
Merge remote-tracking branch 'upstream/main'
pengpeng-lu f4e5cac
Merge remote-tracking branch 'upstream/main'
pengpeng-lu c10ec5b
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 0d9cc50
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 057fee0
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 37c8641
Merge remote-tracking branch 'upstream/main'
pengpeng-lu a52d15a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 74c24fb
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 2f33668
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 01c4d01
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 8c70b2a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 5d59fa2
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 7e84176
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 0d54f1e
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 543a79c
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 8fd8208
Merge remote-tracking branch 'upstream/main'
pengpeng-lu f5b3314
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 9956a9f
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 5476bb4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu f9fd6a9
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 651816c
save
pengpeng-lu 2c886c8
save
pengpeng-lu 38a8004
save
pengpeng-lu 4f7a23f
save
pengpeng-lu 25eb6cf
save
pengpeng-lu 6ebd19b
reformat
pengpeng-lu f8088f5
replace
pengpeng-lu 157ab0c
put keyexpression in separate proto
pengpeng-lu 0daa4ce
checkstyle
pengpeng-lu 9a325bf
checksylte
pengpeng-lu bffaca4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu b3589d2
Merge branch 'main' into udf
pengpeng-lu 46eaaf1
checkstyle
pengpeng-lu 523859e
save
pengpeng-lu 18312ed
Merge remote-tracking branch 'upstream/main'
pengpeng-lu 0a70d6e
merge main
pengpeng-lu d058c09
MacroFunction
pengpeng-lu 67fad06
save
pengpeng-lu 3adcce3
save
pengpeng-lu 74602e7
first clean
pengpeng-lu fa28a85
save
pengpeng-lu b0e5b37
store value
pengpeng-lu 91322a2
project work
pengpeng-lu eee22fc
reformat
pengpeng-lu 41112ed
fix parser
pengpeng-lu df4235e
clean
pengpeng-lu c343ed3
more test
pengpeng-lu 6aaae1d
save
pengpeng-lu 4f2b546
move code
pengpeng-lu e11b315
add test
pengpeng-lu 29b9cb2
pmd
pengpeng-lu 52b3ba4
comments
pengpeng-lu 1cc89a6
save
pengpeng-lu 91e6117
change package
pengpeng-lu 262f03b
fix test compile error
pengpeng-lu 4015220
Merge branch 'udf' into udo
pengpeng-lu e8c4dfc
change
pengpeng-lu 8076737
save
pengpeng-lu cea7e31
clean
pengpeng-lu a71c70b
save
pengpeng-lu ed5e452
merge main
pengpeng-lu 7f030c9
checkstyle
pengpeng-lu e3bbc51
clean
pengpeng-lu f5256d9
nit
pengpeng-lu 6db1c32
merge main
pengpeng-lu 684d5fc
style
pengpeng-lu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...layer-core/src/main/java/com/apple/foundationdb/record/metadata/ScalarValuedFunction.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* UDF.java | ||
pengpeng-lu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* This source file is part of the FoundationDB open source project | ||
* | ||
* Copyright 2015-2025 Apple Inc. and the FoundationDB project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.apple.foundationdb.record.metadata; | ||
|
||
import com.apple.foundationdb.record.PlanHashable; | ||
import com.apple.foundationdb.record.PlanSerializationContext; | ||
import com.apple.foundationdb.record.RecordMetaDataProto; | ||
import com.apple.foundationdb.record.query.plan.cascades.MacroFunction; | ||
import com.apple.foundationdb.record.query.plan.serialization.DefaultPlanSerializationRegistry; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Defines a scalar User-defined-function. | ||
pengpeng-lu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
public class ScalarValuedFunction { | ||
pengpeng-lu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Nonnull | ||
private final MacroFunction macroFunction; | ||
|
||
public ScalarValuedFunction(@Nonnull MacroFunction functionValue) { | ||
this.macroFunction = functionValue; | ||
} | ||
|
||
@Nonnull | ||
public MacroFunction getMacroFunction() { | ||
return macroFunction; | ||
} | ||
|
||
@Nonnull | ||
public String getFunctionName() { | ||
return macroFunction.getFunctionName(); | ||
} | ||
|
||
@Nonnull | ||
public RecordMetaDataProto.ScalarValuedFunction toProto() { | ||
PlanSerializationContext serializationContext = new PlanSerializationContext(DefaultPlanSerializationRegistry.INSTANCE, | ||
PlanHashable.CURRENT_FOR_CONTINUATION); | ||
return RecordMetaDataProto.ScalarValuedFunction.newBuilder() | ||
.setFunctionValue(macroFunction.toProto(serializationContext)) | ||
.build(); | ||
} | ||
|
||
@Nonnull | ||
public static ScalarValuedFunction fromProto(RecordMetaDataProto.ScalarValuedFunction proto) { | ||
PlanSerializationContext serializationContext = new PlanSerializationContext(DefaultPlanSerializationRegistry.INSTANCE, | ||
PlanHashable.CURRENT_FOR_CONTINUATION); | ||
return new ScalarValuedFunction(MacroFunction.fromProto(serializationContext, proto.getFunctionValue())); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.