forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-11856][table-runtime-blink] Introduce BinaryHashTable to batch…
… table runtime. (apache#7949)
- Loading branch information
Showing
29 changed files
with
4,656 additions
and
130 deletions.
There are no files selected for viewing
This file contains 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 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 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
59 changes: 59 additions & 0 deletions
59
...ble-runtime-blink/src/main/java/org/apache/flink/table/dataformat/util/BinaryRowUtil.java
This file contains 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,59 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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:https://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 org.apache.flink.table.dataformat.util; | ||
|
||
import org.apache.flink.core.memory.MemoryUtils; | ||
|
||
/** | ||
* Util for binary row. Many of the methods in this class are used in code generation. | ||
* So ignore IDE warnings. | ||
*/ | ||
public class BinaryRowUtil { | ||
|
||
public static final sun.misc.Unsafe UNSAFE = MemoryUtils.UNSAFE; | ||
public static final int BYTE_ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); | ||
|
||
public static boolean byteArrayEquals(byte[] left, byte[] right, int length) { | ||
return byteArrayEquals( | ||
left, BYTE_ARRAY_BASE_OFFSET, right, BYTE_ARRAY_BASE_OFFSET, length); | ||
} | ||
|
||
public static boolean byteArrayEquals( | ||
Object left, long leftOffset, Object right, long rightOffset, int length) { | ||
int i = 0; | ||
|
||
while (i <= length - 8) { | ||
if (UNSAFE.getLong(left, leftOffset + i) != | ||
UNSAFE.getLong(right, rightOffset + i)) { | ||
return false; | ||
} | ||
i += 8; | ||
} | ||
|
||
while (i < length) { | ||
if (UNSAFE.getByte(left, leftOffset + i) != | ||
UNSAFE.getByte(right, rightOffset + i)) { | ||
return false; | ||
} | ||
i += 1; | ||
} | ||
return true; | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...ink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/JoinCondition.java
This file contains 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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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:https://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 org.apache.flink.table.generated; | ||
|
||
import org.apache.flink.table.dataformat.BaseRow; | ||
|
||
/** | ||
* Interface for code generated condition function for [[org.apache.calcite.rel.core.Join]]. | ||
*/ | ||
public interface JoinCondition { | ||
|
||
/** | ||
* @return true if the join condition stays true for the joined row (in1, in2) | ||
*/ | ||
boolean apply(BaseRow in1, BaseRow in2); | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
.../flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/Projection.java
This file contains 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,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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:https://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 org.apache.flink.table.generated; | ||
|
||
import org.apache.flink.table.dataformat.BaseRow; | ||
|
||
/** | ||
* Interface for code generated projection, which will map a BaseRow to another one. | ||
*/ | ||
public interface Projection<IN extends BaseRow, OUT extends BaseRow> { | ||
|
||
OUT apply(IN row); | ||
|
||
} |
Oops, something went wrong.