Skip to content

Conversation

@Ananya2
Copy link
Contributor

@Ananya2 Ananya2 commented Sep 11, 2025

Overview
This PR fixes critical issues in JSONFunctionTest.java that were causing test failures due to SQL syntax errors and Java version compatibility problems.

Issues Fixed

  1. SQL Syntax Errors in UDF Tests
    Problem: Tests testJsonInputOutputWithUdf and testUdfReturningJson were failing with "Incorrect syntax near 'id'" and "Incorrect syntax near 'data'" errors
    Root Cause: RandomUtil.getIdentifier() intentionally adds single quote characters (') to test identifiers for edge case testing, but SQL Server function calls cannot handle escaped identifiers with special characters
    Solution:
    Replaced generated identifiers with hardcoded schema-qualified function names: "dbo.GetAgeFromJson" and "dbo.GetPersonJson"

  2. JDK 8 Compatibility Issue
    Problem: generateHugeJsonFile() method used String.repeat() which was introduced in Java 11, causing compilation failures on JDK 8
    Solution: Replaced String.repeat(1000) with a StringBuilder loop to maintain Java 8 compatibility

  3. Test Suite Performance Optimization
    Problem: Large JSON payload tests testInsert1GBJson, testInsertHugeJsonData, testInsert2GBData create multi-GB files causing excessive test execution time
    Solution: Added @disabled annotations to these tests while preserving them for manual execution when needed

@Ananya2 Ananya2 self-assigned this Sep 11, 2025
@codecov
Copy link

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.38%. Comparing base (9c41975) to head (28e3a2e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2770      +/-   ##
============================================
+ Coverage     52.30%   52.38%   +0.07%     
+ Complexity     4171     4161      -10     
============================================
  Files           149      149              
  Lines         34241    34241              
  Branches       5718     5718              
============================================
+ Hits          17910    17936      +26     
+ Misses        13874    13838      -36     
- Partials       2457     2467      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ananya2 Ananya2 added this to the 13.2.1 milestone Sep 12, 2025
@Ananya2 Ananya2 merged commit 02ee86c into main Sep 12, 2025
19 checks passed
Ananya2 added a commit that referenced this pull request Sep 12, 2025
Ananya2 added a commit that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants