Calculation method and apparatus
A calculation method and technology for configuration files, applied in the field of big data, can solve problems such as inability to meet requirements, unfixed content, and high performance requirements, and achieve the effect of flexible and convenient configuration process, improved development efficiency, and reduced workload.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Example
[0068] First embodiment
[0069] figure 2 It shows a flowchart of the calculation method provided by the first embodiment of the present invention. This calculation method can be applied, but is not limited to being applied to Spark programs. In the following description, the application of the method in the Spark program is taken as an example for illustration, but it does not constitute a limitation on the protection scope of the present invention. Reference figure 1 , Calculation methods include:
[0070] Step S10: The processor of the electronic device reads and parses the configuration file.
[0071] The configuration file is configured for business requirements, and the business requirements referred to here are usually a data processing task.
[0072] In the Spark program, after the SparkContext is initialized, use the shell command to pass in the storage location of the configuration file on HDFS, use IO to read the configuration file, and parse its content according to the...
Example
[0172] Second embodiment
[0173] In the second embodiment, the calculation method is further explained by comparing the calculation method provided by the embodiment of the present invention with the SQL statement.
[0174] The default database in Hive has two tables: student and sc. The fields of student are sno, sname, sage, sex, and the fields of sc are sno, cno, and score. Figure 4 It shows a schematic diagram of the content of the student table provided by the second embodiment of the present invention. Figure 5 It shows a schematic diagram of the content of the score table provided by the second embodiment of the present invention.
[0175] Now there is a demand: I want to find out all the results of all female students. If you use sparkSQL directly, that is, use a SQL-like way, then the SQL statement should be:
[0176] select score, cno from sc where sno in(select sno from student wheresex=‘female’)
[0177] For ease of explanation, the SQL statement is transformed:
[0178] ...
Example
[0193] Fourth embodiment
[0194] The fourth embodiment of the present invention provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are read and run by a processor, the steps of the calculation method provided by the embodiments of the present invention are executed . The computer-readable storage medium can be implemented as, but not limited to figure 1 The memory 102 is shown.
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap