- Mastering Apache Spark 2.x(Second Edition)
- Romeo Kienzler
- 145字
- 2021-07-02 18:55:33
Code generation
Finally, things can be improved even more, since Apache Spark runs on the Java Virtual Machine (JVM), which allows byte code to be created and modified during runtime. Let's consider an addition of values a and b, resulting in the expression a+b. Normally, this expression had to be interpreted by the JVM for each row of the Dataset. It would be nice if we could generate the JVM ByteCode for this expression on the fly. This is possible, and Catalyst makes use of a very cool Scala feature called Quasiquotes, which basically allows an arbitrary string containing Scala code to be compiled into ByteCode on the fly, if it starts with q. So for example, q"row.get($a)+row.get($b)" will tell the Scala compiler to use this String to generate further JVM byte code. This way, less code has to be interpreted, which speeds things up.
- 精通Nginx(第2版)
- GAE編程指南
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- Redis Applied Design Patterns
- DevOps Automation Cookbook
- Java EE 7 Performance Tuning and Optimization
- Visual C++開發入行真功夫
- C++從入門到精通(第5版)
- C語言程序設計
- Lighttpd源碼分析
- Procedural Content Generation for C++ Game Development
- Julia 1.0 Programming Complete Reference Guide
- UML2面向對象分析與設計(第2版)
- OpenCV with Python Blueprints
- C/C++代碼調試的藝術(第2版)