Skip to content

Commit 11b7a03

Browse files
committed
Merge branch 'master' into cluster_tag_config_flag
2 parents 44d4b51 + a87fdb9 commit 11b7a03

File tree

356 files changed

+14448
-3246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+14448
-3246
lines changed

.github/workflows/product-tests-basic-environment.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ jobs:
4343
steps:
4444
- name: Free Disk Space
4545
if: needs.changes.outputs.codechange == 'true'
46-
run: |
47-
df -h
48-
sudo apt-get clean
49-
rm -rf /opt/hostedtoolcache
50-
df -h
46+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
47+
with:
48+
tool-cache: true
49+
swap-storage: false
5150
- uses: actions/checkout@v4
5251
if: needs.changes.outputs.codechange == 'true'
5352
with:

.github/workflows/spark-integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
group: ${{ github.workflow }}-spark-integration-${{ github.event.pull_request.number }}-${{ matrix.java }}
4343
cancel-in-progress: true
4444
steps:
45+
- name: Free Disk Space
46+
if: needs.changes.outputs.codechange == 'true'
47+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
48+
with:
49+
tool-cache: true
50+
swap-storage: false
4551
- uses: actions/checkout@v4
4652
if: needs.changes.outputs.codechange == 'true'
4753
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ presto-native-execution/deps-install
6666
# Compiled executables used for docker build
6767
/docker/presto-cli-*-executable.jar
6868
/docker/presto-server-*.tar.gz
69+
/docker/presto-function-server-executable.jar

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM quay.io/centos/centos:stream9
33
ARG PRESTO_VERSION
44
ARG PRESTO_PKG=presto-server-$PRESTO_VERSION.tar.gz
55
ARG PRESTO_CLI_JAR=presto-cli-$PRESTO_VERSION-executable.jar
6+
ARG PRESTO_REMOTE_SERVER_JAR=presto-function-server-executable.jar
67
ARG JMX_PROMETHEUS_JAVAAGENT_VERSION=0.20.0
78

89
ENV PRESTO_HOME="/opt/presto-server"
@@ -13,7 +14,8 @@ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
1314
# clean cache jobs
1415
&& mv /etc/yum/protected.d/systemd.conf /etc/yum/protected.d/systemd.conf.bak
1516

16-
COPY --chmod=755 $PRESTO_CLI_JAR /opt/presto-cli
17+
COPY --chmod=755 $PRESTO_CLI_JAR /opt/presto-cli
18+
COPY --chmod=755 $PRESTO_REMOTE_SERVER_JAR /opt/presto-remote-function-server
1719

1820
RUN --mount=type=bind,source=$PRESTO_PKG,target=/$PRESTO_PKG \
1921
# Download Presto and move \

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@
23122312
<dependency>
23132313
<groupId>com.github.luben</groupId>
23142314
<artifactId>zstd-jni</artifactId>
2315-
<version>1.5.6-9</version>
2315+
<version>1.5.7-6</version>
23162316
</dependency>
23172317

23182318
<dependency>
@@ -2348,7 +2348,7 @@
23482348
<dependency>
23492349
<groupId>org.checkerframework</groupId>
23502350
<artifactId>checker-qual</artifactId>
2351-
<version>3.37.0</version>
2351+
<version>3.52.0</version>
23522352
</dependency>
23532353

23542354
<dependency>
@@ -2563,7 +2563,7 @@
25632563
<dependency>
25642564
<groupId>net.jodah</groupId>
25652565
<artifactId>failsafe</artifactId>
2566-
<version>2.0.1</version>
2566+
<version>2.4.4</version>
25672567
</dependency>
25682568

25692569
<dependency>

presto-accumulo/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@
232232
<artifactId>guice</artifactId>
233233
</dependency>
234234

235-
<dependency>
236-
<groupId>commons-lang</groupId>
237-
<artifactId>commons-lang</artifactId>
238-
<version>2.6</version>
239-
</dependency>
240-
241235
<dependency>
242236
<groupId>org.apache.commons</groupId>
243237
<artifactId>commons-lang3</artifactId>

presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import org.apache.accumulo.core.iterators.user.SummingCombiner;
4747
import org.apache.accumulo.core.security.Authorizations;
4848
import org.apache.accumulo.core.security.ColumnVisibility;
49-
import org.apache.commons.lang.ArrayUtils;
49+
import org.apache.commons.lang3.ArrayUtils;
5050
import org.apache.commons.lang3.tuple.Pair;
5151
import org.apache.hadoop.io.Text;
5252

presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordCursor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.apache.accumulo.core.data.Value;
3131
import org.apache.accumulo.core.iterators.FirstEntryInRowIterator;
3232
import org.apache.accumulo.core.iterators.user.WholeRowIterator;
33-
import org.apache.commons.lang.StringUtils;
33+
import org.apache.commons.lang3.StringUtils;
3434
import org.apache.hadoop.io.Text;
3535

3636
import java.io.IOException;

presto-accumulo/src/main/java/com/facebook/presto/accumulo/model/Row.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.google.common.base.Splitter;
2222
import com.google.common.collect.ImmutableList;
2323
import com.google.common.collect.ImmutableMap;
24-
import org.apache.commons.lang.StringUtils;
24+
import org.apache.commons.lang3.StringUtils;
2525

2626
import java.sql.Date;
2727
import java.sql.Time;

presto-analyzer/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.facebook.presto.spi.function.FunctionKind;
3535
import com.facebook.presto.spi.function.table.Argument;
3636
import com.facebook.presto.spi.function.table.ConnectorTableFunctionHandle;
37+
import com.facebook.presto.spi.procedure.DistributedProcedure;
3738
import com.facebook.presto.spi.security.AccessControl;
3839
import com.facebook.presto.spi.security.AccessControlContext;
3940
import com.facebook.presto.spi.security.AllowAllAccessControl;
@@ -176,6 +177,13 @@ public class Analysis
176177
private final Multiset<ColumnMaskScopeEntry> columnMaskScopes = HashMultiset.create();
177178
private final Map<NodeRef<Table>, Map<String, Expression>> columnMasks = new LinkedHashMap<>();
178179

180+
// for call distributed procedure
181+
private Optional<DistributedProcedure.DistributedProcedureType> distributedProcedureType = Optional.empty();
182+
private Optional<QualifiedObjectName> procedureName = Optional.empty();
183+
private Optional<Object[]> procedureArguments = Optional.empty();
184+
private Optional<TableHandle> callTarget = Optional.empty();
185+
private Optional<QuerySpecification> targetQuery = Optional.empty();
186+
179187
// for create table
180188
private Optional<QualifiedObjectName> createTableDestination = Optional.empty();
181189
private Map<String, Expression> createTableProperties = ImmutableMap.of();
@@ -670,6 +678,46 @@ public Optional<QualifiedObjectName> getCreateTableDestination()
670678
return createTableDestination;
671679
}
672680

681+
public Optional<QualifiedObjectName> getProcedureName()
682+
{
683+
return procedureName;
684+
}
685+
686+
public void setProcedureName(Optional<QualifiedObjectName> procedureName)
687+
{
688+
this.procedureName = procedureName;
689+
}
690+
691+
public Optional<DistributedProcedure.DistributedProcedureType> getDistributedProcedureType()
692+
{
693+
return distributedProcedureType;
694+
}
695+
696+
public void setDistributedProcedureType(Optional<DistributedProcedure.DistributedProcedureType> distributedProcedureType)
697+
{
698+
this.distributedProcedureType = distributedProcedureType;
699+
}
700+
701+
public Optional<Object[]> getProcedureArguments()
702+
{
703+
return procedureArguments;
704+
}
705+
706+
public void setProcedureArguments(Optional<Object[]> procedureArguments)
707+
{
708+
this.procedureArguments = procedureArguments;
709+
}
710+
711+
public Optional<TableHandle> getCallTarget()
712+
{
713+
return callTarget;
714+
}
715+
716+
public void setCallTarget(TableHandle callTarget)
717+
{
718+
this.callTarget = Optional.of(callTarget);
719+
}
720+
673721
public Optional<TableHandle> getAnalyzeTarget()
674722
{
675723
return analyzeTarget;
@@ -931,12 +979,12 @@ public Map<AccessControlInfo, Map<QualifiedObjectName, Set<String>>> getUtilized
931979
return ImmutableMap.copyOf(utilizedTableColumnReferences);
932980
}
933981

934-
public void populateTableColumnAndSubfieldReferencesForAccessControl(boolean checkAccessControlOnUtilizedColumnsOnly, boolean checkAccessControlWithSubfields)
982+
public void populateTableColumnAndSubfieldReferencesForAccessControl(boolean checkAccessControlOnUtilizedColumnsOnly, boolean checkAccessControlWithSubfields, boolean isLegacyMaterializedViews)
935983
{
936-
accessControlReferences.addTableColumnAndSubfieldReferencesForAccessControl(getTableColumnAndSubfieldReferencesForAccessControl(checkAccessControlOnUtilizedColumnsOnly, checkAccessControlWithSubfields));
984+
accessControlReferences.addTableColumnAndSubfieldReferencesForAccessControl(getTableColumnAndSubfieldReferencesForAccessControl(checkAccessControlOnUtilizedColumnsOnly, checkAccessControlWithSubfields, isLegacyMaterializedViews));
937985
}
938986

939-
private Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> getTableColumnAndSubfieldReferencesForAccessControl(boolean checkAccessControlOnUtilizedColumnsOnly, boolean checkAccessControlWithSubfields)
987+
private Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> getTableColumnAndSubfieldReferencesForAccessControl(boolean checkAccessControlOnUtilizedColumnsOnly, boolean checkAccessControlWithSubfields, boolean isLegacyMaterializedViews)
940988
{
941989
Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> references;
942990
if (!checkAccessControlWithSubfields) {
@@ -968,19 +1016,26 @@ else if (!checkAccessControlOnUtilizedColumnsOnly) {
9681016
})
9691017
.collect(toImmutableSet())))));
9701018
}
971-
return buildMaterializedViewAccessControl(references);
1019+
return buildMaterializedViewAccessControl(references, isLegacyMaterializedViews);
9721020
}
9731021

9741022
/**
975-
* For a query on materialized view, only check the actual required access controls for its base tables. For the materialized view,
976-
* will not check access control by replacing with AllowAllAccessControl.
1023+
* For a query on materialized view:
1024+
* - When legacy_materialized_views=true: Only check access controls for base tables, bypass access control
1025+
* for the materialized view itself by replacing with AllowAllAccessControl.
1026+
* - When legacy_materialized_views=false: Check access control for both the materialized view itself
1027+
* and all base tables referenced in the view query.
9771028
**/
978-
private Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> buildMaterializedViewAccessControl(Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> tableColumnReferences)
1029+
private Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> buildMaterializedViewAccessControl(Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> tableColumnReferences, boolean isLegacyMaterializedViews)
9791030
{
9801031
if (!(getStatement() instanceof Query) || materializedViews.isEmpty()) {
9811032
return tableColumnReferences;
9821033
}
9831034

1035+
if (!isLegacyMaterializedViews) {
1036+
return tableColumnReferences;
1037+
}
1038+
9841039
Map<AccessControlInfo, Map<QualifiedObjectName, Set<Subfield>>> newTableColumnReferences = new LinkedHashMap<>();
9851040

9861041
tableColumnReferences.forEach((accessControlInfo, references) -> {
@@ -1037,6 +1092,16 @@ public Optional<QuerySpecification> getCurrentQuerySpecification()
10371092
return currentQuerySpecification;
10381093
}
10391094

1095+
public void setTargetQuery(QuerySpecification targetQuery)
1096+
{
1097+
this.targetQuery = Optional.of(targetQuery);
1098+
}
1099+
1100+
public Optional<QuerySpecification> getTargetQuery()
1101+
{
1102+
return this.targetQuery;
1103+
}
1104+
10401105
public Map<FunctionKind, Set<String>> getInvokedFunctions()
10411106
{
10421107
Map<FunctionKind, Set<String>> functionMap = new HashMap<>();

0 commit comments

Comments
 (0)