← Back to list

Practical Guide: Spark Graph Viewer — From Table to Graph Without Complications

Continuing our exploration of graph processing within the Apache Spark ecosystem, this article delves into the practical application of…

Antoniodn · 2026-03-18 10:03 · 4 claps · 3.0 min read
#apache-spark #data-visualization #graph-analysis #data-science #big-data
Open on Medium ↗
Wiki topics: FT · Fine-tuning & Adaptation ML · Machine Learning VIS · Visual & Graphic Design 🔧 · Data Engineering 🔬 · Science · General

Practical Guide: Spark Graph Viewer — From Table to Graph Without Complications

Continuing our exploration of graph processing within the Apache Spark ecosystem, this article delves into the practical application of Spark Graph Viewer. This tool was designed to enable visual and interactive analysis of tabular data, eliminating the barriers of complex coding and the need for data replication.

1. Fundamentals and Data Abstraction

Spark Graph Viewer operates directly on existing structures, mapping them according to fundamental graph concepts:

  • Vertices (Nodes): Entities representing network points. Each vertex includes identification fields (ID), a Label for display, and a Type for visual categorization.
  • Edges (Connections): Represent the relationships between vertices, requiring Source ID and Destination ID keys.

2. Source Configuration and Mapping

The configuration interface allows for direct coupling with the Spark data catalog. Users must define:

  • Data Source: Specification of the Catalog, Schema, and the respective Vertex and Edge tables.
  • Attribute Definition: Mapping of fields that serve as unique identifiers and visualization metadata (Label and Type).
  • Filter Layer: Application of predicates using Spark SQL syntax to create data subsets (analysis windows), optimizing initial processing.

3. Query Engines and Pattern Analysis

The tool provides four search modalities for various use cases, such as fraud detection or logistics optimization:

  • MOTIF Find: Utilizes a declarative language to search for structural patterns. Example: (v1)-[e1]->(v2); (v2)-[e2]->(v3). In MOTIF queries, filter fields must be qualified (e.g., v1.status = ‘active’).
  • Shortest Path: An algorithm to locate the shortest path between two specific nodes, supporting global filters on edges.
  • All Paths: Identifies all possible routes between two points — essential for network redundancy analysis.
  • Triangulation: Identifies cycles and redundant processes where the origin and destination coincide, a fundamental technique for process auditing.

4. SQL-Powered Filtering

Spark Graph Viewer integrates Spark SQL syntax for applying filters to vertex and edge fields. This functionality allows for the precise isolation of data subsets, such as transactions exceeding predefined values or routes linked to specific schedules.

5. Performance Optimization

Graph queries are computationally intensive operations. As a best practice, it is recommended to:

  1. Scale Gradually: Start searches with a small number of hops (distance).
  2. Refine Filters: Use rigorous SQL filters to reduce the volume of data processed in memory.
  3. Controlled Expansion: Increase analysis depth only after identifying relevant patterns.

6. Availability of Test Data

The project includes a pre-loaded dataset that can be used with the notebook located in the ./graph-notebook/graph_notebook_bank.json directory for immediate validation of core features and technical evaluation. This controlled environment allows for the exploration of the system’s operational capabilities before integration with external or production data sources. The test environment comes with Jupyter Notebook pre-installed, facilitating the loading of additional databases for assessment.

Conclusion

Spark Graph Viewer extends the capabilities of Apache Spark by offering a visual abstraction layer that accelerates insights into complex networks. By combining the robustness of Spark SQL with the clarity of graphs, the tool becomes a strategic asset for data analysts and engineers.

The project is open-source and available to the community. Download it now, explore its features, and contribute to its development.

Useful Links

To access the full code, visit our official GitHub page:

GitHub: *antoniodn/spark-graph-viewer: Spark Graph Viewer — Turn your data into visual insights with Apache Spark — simple, fast, and interactive.*

Read the previous article here: *Simplifying Graph Analysis in Apache Spark with the Spark Graph Viewer | by Antoniodn | Mar, 2026 | Medium*

LinkedIn: *Antonio Domingues Neto | LinkedIn*


메타데이터
post_id
18dd4b61c8a2
slug
practical-guide-spark-graph-viewer-from-table-to-graph-without-complications-18dd4b61c8a2
url
https://medium.com/@antoniodn/practical-guide-spark-graph-viewer-from-table-to-graph-without-complications-18dd4b61c8a2
canonical_url
https://medium.com/@antoniodn/practical-guide-spark-graph-viewer-from-table-to-graph-without-complications-18dd4b61c8a2
author_url
https://medium.com/@antoniodn
status
ok
fetched_at
2026-06-20 20:29:01