Fix GEOMETRY/GEOGRAPHY DATA_TYPE mapping in Thrift getColumns() (#1387) #5684
This file contains hidden or 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 will run for all PRs | |
| name: Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: # Unit tests can be run for all external PRs | |
| types: [opened, synchronize, reopened] | |
| branches: [ main ] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| formatting-check: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [21] # For formatting, we don't need to run across multiple versions. Only sanity testing is required here, rest is taken care in the build. | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| steps: | |
| - name: Set up JDK | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'adopt' | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| - name: Check if fork | |
| id: fork-check | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event.pull_request.head.repo.full_name }}" != "" ] && \ | |
| [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then | |
| echo "is_fork=true" >> $GITHUB_OUTPUT | |
| echo "This is a forked PR — will use cached dependencies" | |
| else | |
| echo "is_fork=false" >> $GITHUB_OUTPUT | |
| echo "This is a same-repo PR or push — will use JFrog OIDC" | |
| fi | |
| - name: Setup Maven | |
| uses: ./.github/actions/setup-maven | |
| with: | |
| is-fork: ${{ steps.fork-check.outputs.is_fork }} | |
| - name: Check formatting | |
| run: mvn --errors spotless:check | |
| unit-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [11, 17, 21] # Adding LTS versions here. 21 is the latest LTS | |
| github-runner: [ linux-ubuntu-latest, windows-server-latest ] | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: ${{ matrix.github-runner }} | |
| steps: | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'adopt' | |
| - name: Enable long paths | |
| if: runner.os == 'Windows' | |
| run: git config --system core.longpaths true | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| - name: Check if fork | |
| id: fork-check | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event.pull_request.head.repo.full_name }}" != "" ] && \ | |
| [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then | |
| echo "is_fork=true" >> $GITHUB_OUTPUT | |
| echo "This is a forked PR — will use cached dependencies" | |
| else | |
| echo "is_fork=false" >> $GITHUB_OUTPUT | |
| echo "This is a same-repo PR or push — will use JFrog OIDC" | |
| fi | |
| - name: Setup Maven | |
| uses: ./.github/actions/setup-maven | |
| with: | |
| is-fork: ${{ steps.fork-check.outputs.is_fork }} | |
| - name: Set up Maven Toolchains | |
| shell: bash | |
| run: | | |
| mkdir -p ~/.m2 | |
| cat > ~/.m2/toolchains.xml <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <toolchains> | |
| <toolchain> | |
| <type>jdk</type> | |
| <provides> | |
| <version>${{ matrix.java-version }}</version> | |
| </provides> | |
| <configuration> | |
| <jdkHome>$JAVA_HOME</jdkHome> | |
| </configuration> | |
| </toolchain> | |
| </toolchains> | |
| EOF | |
| - name: Check Arrow Patch Tests | |
| shell: bash | |
| if: matrix.java-version >= 17 | |
| run: mvn -Pjdk${{ matrix.java-version }}-NioNotOpen -pl jdbc-core test -Dgroups='Jvm17PlusAndArrowToNioReflectionDisabled' | |
| - name: Check Arrow Allocator Manager Tests | |
| shell: bash | |
| if: matrix.java-version >= 17 | |
| run: mvn -Pjdk${{ matrix.java-version }}-NioNotOpen -pl jdbc-core test -Dgroups='Jvm17PlusAndArrowToNioReflectionDisabled' -Dtest="ArrowBufferAllocatorNettyManagerTest,ArrowBufferAllocatorUnsafeManagerTest,ArrowBufferAllocatorUnknownManagerTest" -DforkCount=1 -DreuseForks=false | |
| - name: Check Arrow Memory Tests | |
| shell: bash | |
| run: mvn -Plow-memory -pl jdbc-core test -Dtest='DatabricksArrowPatchMemoryUsageTest' | |
| - name: Check Unit Tests | |
| shell: bash | |
| run: mvn -pl jdbc-core clean test -Dgroups='!Jvm17PlusAndArrowToNioReflectionDisabled' jacoco:report | |
| - name: Install xmllint | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libxml2-utils | |
| - name: Extract codeCov percentage | |
| shell: bash | |
| run: | | |
| COVERAGE_FILE="jdbc-core/target/site/jacoco/jacoco.xml" | |
| COVERED=$(xmllint --xpath "string(//report/counter[@type='INSTRUCTION']/@covered)" "$COVERAGE_FILE") | |
| MISSED=$(xmllint --xpath "string(//report/counter[@type='INSTRUCTION']/@missed)" "$COVERAGE_FILE") | |
| TOTAL=$((COVERED + MISSED)) | |
| # Use Python for floating-point math | |
| PERCENTAGE=$(python -c "covered=${COVERED}; total=${TOTAL}; print(round((covered/total)*100, 2))") | |
| echo "$PERCENTAGE" > coverage.txt | |
| echo "::set-output name=coverage::$PERCENTAGE" | |
| - name: Check coverage percentage | |
| shell: bash | |
| run: | | |
| BRANCH_COVERAGE=$(cat coverage.txt) | |
| echo "Branch Coverage: $BRANCH_COVERAGE%" | |
| # Use Python to compare the coverage with 85 | |
| python -c "import sys; sys.exit(0 if float('$BRANCH_COVERAGE') >= 85 else 1)" | |
| if [ $? -eq 1 ]; then | |
| echo "Coverage is less than 85%" | |
| exit 1 | |
| else | |
| echo "Coverage is equal to or greater than 85%" | |
| fi | |
| packaging-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [ 17 ] | |
| github-runner: [ linux-ubuntu-latest, windows-server-latest ] | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: ${{ matrix.github-runner }} | |
| steps: | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'adopt' | |
| - name: Enable long paths | |
| if: runner.os == 'Windows' | |
| run: git config --system core.longpaths true | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| - name: Check if fork | |
| id: fork-check | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event.pull_request.head.repo.full_name }}" != "" ] && \ | |
| [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then | |
| echo "is_fork=true" >> $GITHUB_OUTPUT | |
| echo "This is a forked PR — will use cached dependencies" | |
| else | |
| echo "is_fork=false" >> $GITHUB_OUTPUT | |
| echo "This is a same-repo PR or push — will use JFrog OIDC" | |
| fi | |
| - name: Setup Maven | |
| uses: ./.github/actions/setup-maven | |
| with: | |
| is-fork: ${{ steps.fork-check.outputs.is_fork }} | |
| - name: Set up Maven Toolchains | |
| shell: bash | |
| run: | | |
| mkdir -p ~/.m2 | |
| cat > ~/.m2/toolchains.xml <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <toolchains> | |
| <toolchain> | |
| <type>jdk</type> | |
| <provides> | |
| <version>${{ matrix.java-version }}</version> | |
| </provides> | |
| <configuration> | |
| <jdkHome>$JAVA_HOME</jdkHome> | |
| </configuration> | |
| </toolchain> | |
| </toolchains> | |
| EOF | |
| - name: Install JDBC artifacts into maven local | |
| shell: bash | |
| run: mvn -B -pl jdbc-core,assembly-uber,assembly-thin install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Ddependency-check.skip=true | |
| # Only run on push to main; secrets are not available for fork PRs | |
| - name: Check Uber Jar Packaging | |
| if: github.event_name == 'push' | |
| shell: bash | |
| run: mvn -pl test-assembly-uber test | |
| env: | |
| DATABRICKS_HOST: ${{ secrets.JDBC_PAT_TEST_HOST_NAME }} | |
| DATABRICKS_HTTP_PATH: ${{ secrets.JDBC_PAT_TEST_HTTP_PATH }} | |
| DATABRICKS_USER: ${{ secrets.DATABRICKS_USER }} | |
| DATABRICKS_TOKEN: ${{ secrets.JDBC_PAT_TEST_TOKEN }} | |
| # Only run on push to main; secrets are not available for fork PRs | |
| - name: Check Thin Jar Packaging | |
| if: github.event_name == 'push' | |
| shell: bash | |
| run: mvn -pl test-assembly-thin test | |
| env: | |
| DATABRICKS_HOST: ${{ secrets.JDBC_PAT_TEST_HOST_NAME }} | |
| DATABRICKS_HTTP_PATH: ${{ secrets.JDBC_PAT_TEST_HTTP_PATH }} | |
| DATABRICKS_USER: ${{ secrets.DATABRICKS_USER }} | |
| DATABRICKS_TOKEN: ${{ secrets.JDBC_PAT_TEST_TOKEN }} |