Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the solution of self-help query in big data?

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to introduce to you what is the solution of self-help query in big data. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

If you have ever traveled abroad, especially to Europe alone, have you ever had a painful experience of ordering food in a restaurant? (of course, McDonald's and K don't count. In the face of the specious words on the menu, are there any worries about mulberry? Is there any melancholy? Is there anything very... Uh, hungry?

Similarly, when doing front-end business queries, if you don't know the language of "ordering" like SQL, how do you find those fields and set those conditions? Do you have the same sadness and melancholy? And hunger?

However, it is different now, because we have the V2018 query control! TA is like a dazzling array of pots and pans in the cafeteria, hidden deep in the database. The data in) is clearly presented in front of you, you can choose the combination, and you can have a gluttonous feast of data anytime and anywhere!

Let's take a look at the order data in the following figure.

Let's take a look at how to use the query control of the drying report V2018 to query all the order information made by the salesperson with employee ID 3 from the order data:

I am proud to tell you that the above query results do not need to write any SQL statements, just drag and drop fields to query the desired data, and support a variety of databases, support externally stored data, is this like buffet, and a variety of flavors, and even bring your own drinks? Most importantly, the query control can also do where it needs to be embedded, just like opening the cafeteria to your own home and work.

In order to do this, so that business staff can easily query data from the database, we have exhausted our efforts, why not come quickly and cheer for us?

Next, we will describe in detail how to use the dry report V2018 query control and how to integrate the dry report V2018 query control into your own system.

Introduce query control

For the convenience of developers, the drying report encapsulates some specific functions using the tag tag.

In the following example, we create a new JSP file in the reportJsp directory under the moistening report demo application: test.jsp, add the tag tag to publish access, and the jsp content is as follows:

My Test Jsp guideConf.analysePage = "raqsoft/guide/jsp/analyse.jsp"; / / Analysis interface, which is used to display the analysis query results

To explain briefly, it is shown with tags in this jsp, where:

Qyx is used to set the qyx file name that needs to be displayed by default (the drag-and-drop result of the query control can be saved as a file with the file extension qyx).

DataSource defines the name of the data source.

Dictionary definition dictionary file (the dictionary file has been mentioned in "when Multidimensional Analysis encounters predefined semantics", so I won't say much here).

Visibility defines visual files (visual files will be discussed in later articles, which will not be explained here).

Note: both qyx and dataSource property names must be present, and at least one of them is not empty. When qyx exists, the dataSource setting will be ignored.

We save the test.jsp file in [installation directory] / report/web/webapps/demo/reportJsp.

Use the query control

To use the query control, you need to use the semantic layer mentioned in "when Multidimensional Analysis encounters predefined semantics."

Open the DQL metadata layer designer, select "data Source" under the system menu, configure the data source and connect. Make sure the connected database is started before connecting. The demo data in the example comes from the dqldemo database that comes with it, so the database does not need to be configured.

After starting the database through the Service-start sample Database menu, connect to the dqldemo data source in the data source dialog box. Use the "Import Database Table" function to import order details, employees, customers, orders and other database tables into the newly created metadata file (the metadata file has been mentioned in "when the predefined semantics of multidimensional analysis encounters predefined semantics". Save it as order .lmd, as follows:

Change the content in the [installation directory] / report/services/datalogic/service.xm to, and place the order .lmd in the [installation directory] / report/services/datalogic/conf directory. Finally, start the DQL server and Tomcat.

Visit the sample jsp to show the query control

Open the browser, type url: http://localhost:6868/demo/reportJsp/test.jsp, and we gradually unveil the query control.

As shown in the figure above, there is a list of metrics on the left and a query area on the right.

Drag and drop table fields

When querying, you only need to drag and drop the fields in the metric list that need to be queried to the metrics query area. For example, drag "order ID", "employee ID" and "order amount" from the left indicator list to the right indicator query area, and the indicator list area will automatically list the relevant tables.

Ahem, if you need to query the data of the whole table, you don't have to drag all the fields one by one, of course not. Get is a little trick, just drag and drop the table name. Oh, you can try it.

Data filtering

To query all order information made by salespeople whose employee ID is 3, click "filter criteria" in the criteria column of the "employee ID" row

Enter filter criteria: 3

Click the Save button.

Query data

Click the query data button to jump to the DQL query results page, and the data displayed in the report is the filtered data.

If you also want to filter the order amount, you only need to add filter conditions to the order amount, for example: query the order amount that is greater than 10000:

The result is:

How, through the above steps, is it very easy to complete the query? The whole process does not involve any manual writing of SQL statements, and the operation is flexible, the style is beautiful, and the data is clear at a glance. Do you suddenly feel cool all summer?

Next, we can also save the query data locally in the form of TXT,CSV,Excel,Word,TXT,PDF and other files, of course, we can also use pdf to print directly.

Analysis data

In addition to querying the data, we can also analyze the query results flexibly. Click the analyze data button, jump to the DQL grouping analysis page, and get a dataset in which the filtered data is stored and displayed in the report. By setting different conditions in the data analysis control, we can analyze the data as much as we can.

This page still supports saving the queried data locally as a TXT,CSV,Excel,Word,TXT,PDF file or printing directly through pdf.

However, it should be noted that if the result of query analysis has a large amount of data, the data in the report may be incomplete, only part of the data can be intercepted, and the display will be slow, memory consumption will be particularly large, and even cause the application to crash. If this happens, do not panic, we have come up with a solution, take a look at "give a SQL can do multi-dimensional analysis".

See here, you are not a little eager to try, do not worry, then let's focus on the face problem, hee hee, that is, the style of the query interface.

Modify query control

The use of Tag tag attributes can only control the display of some initial metric data, and if you want to change the style of the query interface, you need to dry out the JS API provided by the report. The js code is located at the end of the jsp.

What if you want to query only one table without listing the other tables? Do you want to recreate the metadata file? No! Never! . All you need is one line of Javascript code:

GuideConf.fixedTable = "order"; / / only show order table

After adding the Tag tag, the default menu bar is displayed. If you think the menu bar is not beautiful enough, you can use the following code-behind menu bar:

GuideConf.showToolBar = "no"; / / does not display the toolbar

After the menu bar is hidden, you can customize the button. In order to facilitate the use of the custom button, we specially provide the JS method for users to call directly in the button:

Save: queryApi.saveQyx (); Open: queryApi.openQyx (); undo: queryApi.undo (); redo: queryApi.redo (); query: queryApi.submitQuery ()

Sample code:

Customize the open button

Not only that, we can also change the editing style after the query interface is initialized.

Sample code:

(document) .ready (* * function** () {queryApi.setEditStyleDef ({name:'_date',type:3,dateFormat:'yy/mm/dd'});})

What is the effect of the revision? you can try it yourself.

The above is the whole content of what is the solution of self-help query in big data. More content related to what is the solution of self-help query in big data can search the previous articles or browse the following articles to learn ha! I believe the editor will add more knowledge to you. I hope you can support it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report