Skip to content

Gremlin to Spark SQL Conversion with Visualization#2

Draft
tanvi2410 wants to merge 8 commits into
wmoustafa:data-generationfrom
tanvi2410:gremlin-coral-ir
Draft

Gremlin to Spark SQL Conversion with Visualization#2
tanvi2410 wants to merge 8 commits into
wmoustafa:data-generationfrom
tanvi2410:gremlin-coral-ir

Conversation

@tanvi2410
Copy link
Copy Markdown

@tanvi2410 tanvi2410 commented Jan 28, 2026

Summary

Converts Apache TinkerPop Gremlin graph queries to optimized Spark SQL with flat output and visual execution plans.

Key Features

Multi-hop graph traversals with correct join conditions and field references
Custom flat SQL generator - eliminates nested SELECTs, produces readable SQL with qualified field names
RelNode visualization - Graphviz diagrams showing query execution plans
Web UI - React form with configurable schemas and multi-panel results display

Example
Gremlin Query

g.V().has("name", "Tanvi").outE("friend").inV()
  .outE("friend").inV().has("age", gt(25))
  .order().by("age", decr).valueMap("name", "age", "city")

SQL Query

SELECT t4.name, t4.age, t4.city
FROM default.people AS t0
INNER JOIN default.relationships AS t1 ON t0.person_id = t1.src_person AND t1.relation = 'friend'
INNER JOIN default.people AS t2 ON t1.dst_person = t2.person_id
INNER JOIN default.relationships AS t3 ON t2.person_id = t3.src_person AND t3.relation = 'friend'
INNER JOIN default.people AS t4 ON t3.dst_person = t4.person_id
WHERE t0.name = 'Tanvi' AND t4.age > 25
ORDER BY t4.age DESC

Test

  • Added New Test
  • Run the shell script and compare the result
  • Tested the result in UI

- Implement GremlinToRelConverter for direct Gremlin to RelNode conversion
- Add REST API endpoint /api/gremlin/convert in coral-service
- Add shell script client for easy CLI usage
- Support common Gremlin patterns: g.V(), g.E(), .has(), .out(), .in(), .values()
- Include comprehensive unit tests
- Update documentation with architecture and usage examples
@tanvi2410 tanvi2410 changed the title Gremlin coral ir Gremlin to Spark SQL Conversion with Visualization Jan 30, 2026
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.

2 participants