Skip to content

Commit

Permalink
feat: add aupport for AddArtifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jun 4, 2024
1 parent 6dc831a commit 7f71efe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gateway/demo/USING_SCALA.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SPARK_REMOTE=sc://localhost:50051 spark-connect-repl


```commandline
var lineitem = spark.read.parquet("/Users/davids/projects/voltrondata-spark-substrait-gateway/third_party/tpch/parquet/lineitem")
var lineitem = spark.read.parquet("third_party/tpch/parquet/lineitem")
var result = lineitem.filter($"l_shipdate" <= "1998-09-02").groupBy($"l_returnflag", $"l_linestatus").agg(sum($"l_quantity"), sum($"l_extendedprice"), sum($"l_extendedprice" * ($"l_discount" + -1) * -1), sum($"l_extendedprice" * ($"l_discount" + -1) * ($"l_tax" + 1) * -1), avg($"l_quantity"), avg($"l_extendedprice"), avg($"l_discount"), count($"l_quantity")).sort($"l_returnflag", $"l_linestatus")
Expand Down
9 changes: 8 additions & 1 deletion src/gateway/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,14 @@ def AddArtifacts(self, request_iterator, context):
"""Add the given artifacts to the server."""
self._statistics.add_artifacts_requests += 1
_LOGGER.info('AddArtifacts')
return pb2.AddArtifactsResponse()
response = pb2.AddArtifactsResponse()
for request in request_iterator:
_LOGGER.info(' batch: %s', request)
for artifact in request.batch.artifacts:
response.artifacts.append(pb2.AddArtifactsResponse.ArtifactSummary(
name=artifact.name, is_crc_successful=True
))
return response

def ArtifactStatus(self, request, context):
"""Get the status of the given artifact."""
Expand Down

0 comments on commit 7f71efe

Please sign in to comment.