-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12ecc43
commit d46393e
Showing
11 changed files
with
1,502 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project-shared-configuration> | ||
<!-- | ||
This file contains additional configuration written by modules in the NetBeans IDE. | ||
The configuration is intended to be shared among all the users of project and | ||
therefore it is assumed to be part of version control checkout. | ||
Without this configuration present, some functionality in the IDE may be limited or fail altogether. | ||
--> | ||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> | ||
<!-- | ||
Properties that influence various parts of the IDE, especially code formatting and the like. | ||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up. | ||
That way multiple projects can share the same settings (useful for formatting rules for example). | ||
Any value defined here will override the pom.xml file value but is only applicable to the current project. | ||
--> | ||
<netbeans.hint.jdkPlatform>JDK_11.0.19-amzn</netbeans.hint.jdkPlatform> | ||
</properties> | ||
</project-shared-configuration> |
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,49 @@ | ||
/* | ||
* 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 io.trino.parquet.writer.repdef; | ||
|
||
import com.google.common.collect.Iterables; | ||
import org.apache.parquet.column.values.ValuesWriter; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface DefLevelWriterProvider | ||
{ | ||
DefinitionLevelWriter getDefinitionLevelWriter(Optional<DefinitionLevelWriter> nestedWriter, ValuesWriter encoder); | ||
|
||
interface DefinitionLevelWriter | ||
{ | ||
ValuesCount writeDefinitionLevels(int positionsCount); | ||
|
||
ValuesCount writeDefinitionLevels(); | ||
} | ||
|
||
record ValuesCount(int totalValuesCount, int maxDefinitionLevelValuesCount) | ||
{ | ||
} | ||
|
||
static DefinitionLevelWriter getRootDefinitionLevelWriter(List<DefLevelWriterProvider> defLevelWriterProviders, ValuesWriter encoder) | ||
{ | ||
// Constructs hierarchy of DefinitionLevelWriter from leaf to root | ||
DefinitionLevelWriter rootDefinitionLevelWriter = Iterables.getLast(defLevelWriterProviders) | ||
.getDefinitionLevelWriter(Optional.empty(), encoder); | ||
for (int nestedLevel = defLevelWriterProviders.size() - 2; nestedLevel >= 0; nestedLevel--) { | ||
DefinitionLevelWriter nestedWriter = rootDefinitionLevelWriter; | ||
rootDefinitionLevelWriter = defLevelWriterProviders.get(nestedLevel) | ||
.getDefinitionLevelWriter(Optional.of(nestedWriter), encoder); | ||
} | ||
return rootDefinitionLevelWriter; | ||
} | ||
} |
Oops, something went wrong.