Skip to content

Commit

Permalink
Merge pull request #6 from andygrove/sunday
Browse files Browse the repository at this point in the history
Add instructions for installing protoc and fix two compiler warnings
  • Loading branch information
andygrove authored Sep 19, 2021
2 parents 76c080a + 90d875a commit 9c27d47
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/jvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:

steps:
- name: Install Protoc
uses: arduino/setup-protoc@master
uses: arduino/setup-protoc@v1
with:
version: '3.11.4'
- name: Checkout Git branch
uses: actions/checkout@v2
- name: Set up JDK 1.8
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ The following expressions are supported:

## Installing Locally

### Install the Google Protocol Buffer compiler

The gradle build script uses the protobuf-gradle-plugin Gradle plugin to generate Java source code from the Ballista protobuf file and this depends on the protobuf compiler being installed.

Use the following instructions to install the protobuf compiler on Ubuntu or similar Linux platforms.

```bash
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protobuf-all-3.11.4.tar.gz
tar xzf protobuf-all-3.11.4.tar.gz
cd protobuf-3.11.4/
./configure
make
sudo make install
sudo ldconfig
```

### Build libraries

```bash
cd jvm
./gradlew publishToMavenLocal
Expand Down
2 changes: 1 addition & 1 deletion jvm/examples/src/main/kotlin/ParallelQuery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun main() {

val start = System.currentTimeMillis()
val deferred =
(1..2).map { month ->
(1..12).map { month ->
GlobalScope.async {
val sql =
"SELECT passenger_count, " +
Expand Down
4 changes: 1 addition & 3 deletions jvm/executor/src/main/kotlin/BallistaFlightProducer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ class BallistaFlightProducer : FlightProducer {

val allocator = RootAllocator(Long.MAX_VALUE)

var batchSize = 1024

val root = VectorSchemaRoot.create(schema.toArrow(), allocator)
listener.start(root, null)

Expand All @@ -66,7 +64,7 @@ class BallistaFlightProducer : FlightProducer {
val rowCount = batch.rowCount()
println("Received batch with $rowCount rows")

batchSize = rowCount
var batchSize = rowCount
root.fieldVectors.forEach { it.setInitialCapacity(batchSize) }
root.allocateNew()

Expand Down
2 changes: 1 addition & 1 deletion jvm/fuzzer/src/main/kotlin/Fuzzer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class EnhancedRandom(val rand: Random) {
}

fun nextString(len: Int): String {
return (0 until len).map { i -> rand.nextInt(charPool.size) }
return (0 until len).map { _ -> rand.nextInt(charPool.size) }
.map(charPool::get)
.joinToString("")
}
Expand Down

0 comments on commit 9c27d47

Please sign in to comment.