how to write queries in Hive Web Interface - hadoop

I was playing around with hwi, I got it started.Now I can see the different schemas which are present. But I don't know how to query them. I tried to check hive wiki (https://cwiki.apache.org/confluence/display/Hive/HiveWebInterface) but they dont seem to have much information put over there. There seems to be a Running a query section in Walk through but it says image not found.
Anybody who has used HWI to query please suggest a way to use it.

Try these steps :
Open HWI : http://localhost:9999/hwi/index.jsp
Click on Authorize in the left pane. This will open the Change User Info section. Enter the username and hit submit to complete the authorization process. Upon successful authorization you'll see Authorization is complete at the top of your page.
Now click on Create Session, enter some session name and hit Submit.
Once you submit the session name you'll get the Manage Session screen. This is the place where all the action will take place. Come down to the Session Details section and enter a file name, say /Users/tariq/res.txt, in the Result File box. This is the file where the result of your query will get stored. If you expect your result to be very huge you can just enter /dev/null over there. Remember the result file is local to the web server. Similarly enter the error file if you wish.
Now come down to the Query box and write the query you want to execute.
Come down further to the Start Query drop down list, click on it and elect YES and hit Submit.
You should be able to see the file /Users/tariq/res.txt by now containing the result of your query. You can also view the result by clicking on View File option which will appear next to the Result File box upon the successful completion of your query.
HTH

Take a look at Hue - http://cloudera.github.io/hue/
This project is bundled with the Cloudera installation and seems to work rather well.
Best,
Sukrit

Related

Cypress test fails but works when tested manually

I am trying to test the ability to retrieve results from a database. When running a test that logs in, navigates to the search tab and searches a word, I am getting a 401. If I go to the website, use the same log in information and do the exact same steps, it works perfectly. Here's the last few steps of the test:
cy.contains('Search').click(); //open tab
cy.contains('Search by').click();
cy.contains('Name').click();
cy.get('.search-field').type('Jane');
cy.get('.search-btn').click();
There's a drop down menu for what you want to search by, a textfield for the search word and a search button. I can't share all of the code but I can see from the video that logging in and all the following steps are performed as supposed to. What kind of things can cause a cypress test to return different results as opposed to manually performing the action? I added wait(2000)'s in between the steps but it made no difference.
Maybe there is an event that needs to be triggered before the page is able to search.
Take a look at the element you are typing into in the devtools, under the Event Listeners tab.
For example, the StackOverflow search box has an event for s-popover:show listed there - if testing that you would .trigger('s-popover:show') to fire that event and display the instruction tooltip.
So try something like this
cy.get('.search-field')
.type('Jane')
.trigger('change') // or .trigger('input')
Cypress deletes localStorage in between tests. In this case that deleted the authorization token which is why I was getting the 401. I installed this package: https://www.npmjs.com/package/cypress-localstorage-commands
After the log in I use
cy.saveLocalStorage();
And before making search
cy.restoreLocalStorage();

How to create a Checkpoint in UFT

Strange enough that I have to ask such a simple question.
I started automating with UFT and I suppose the correct way to check if for instance my login has worked is to add a checkpoint on the next page.
But how do I do that?
All info I get from google is on how to add an already existing checkpoint to may page. But I don't have any.
Here is how I go about automating:
I add manually the relevant objects to the object repository
I create parameters for my action
I create the code that does the steps on the page
one action per page seems to be fine for me
But in the Object Repository of UFT 14.53, there is no button to add a Checkpoint.
A workaround for me would be to just add another Object and check it's existence and forget about checkpoints. Until I hopefully get an answer here, I will try to do just that.
In UFT there are typically two ways to verify that things are working as expected.
Flow (implicit) - In order to verify that progress in the application is successful (e.g. login) one usually just keeps working with the app, assuming that if the previous step failed, the objects needed for the next steps won't exist and the test will fail due to ObjectNotFound errors
State (explicit) - In order to see that objects have a specific state, checkpoints are usually used. Checkpoints are typically added during a record session, I'm not sure if there's a way to add them directly to the repository. An alternative to checkpoints, which works better with keyword driven testing (no recording), is to use the built in CheckProperty method.

How do I programmatically login through Auth0 Lock interface?

I'm trying to write a WebPageTest custom script that involves programmatically logging into my web app's Auth0 Lock interface as the first step but haven't been able to get it working.
I set up a private WebPageTest server to get a closer look at what was happening, and from the server logs it looks like the WebPageTest script is setting the value of the username/password fields and clicking submit using vanilla DOM manipulation (i.e. querySelector, click, etc.) but upon form submission, Auth0 Lock doesn't recognize that anything has been filled out in those fields. There's errors saying those fields can't be blank when submit is clicked.
I've used a local WebPageTest Node agent with my private server to successfully login through the Lock widget but don't know how to get performance logs using that approach (no results show after I get to the test results page). That login approach seems to work because the values going into the input fields get programmatically "typed in" through the WebDriver sendKeys function.
I came across this related post on Auth0 forums but don't know how I can incorporate what's being recommended there in the context of a WebPageTest script.
You can reproduce the problem I'm experiencing by going to the Auth0 Lock sample at the top of this page and running the following code in your devtools console:
document.querySelector('.auth0-lock-input[name=email]').value = 'hello#hello.com';
document.querySelector('.auth0-lock-input[name=password]').value = 'testing';
setTimeout(() => document.querySelector('.auth0-lock-submit').click(), 1000)
I expect to be able to programmatically enter input field info and submit it through the Auth0 Lock widget but haven't been able to do so. Does anyone have a solution to this?
The login page uses javascript/ajax to create the login form and its input elements. You're simply doing stuff too fast, not waiting for the elements to be created first, in order to populate and submit them. Just wait for the form and its input elements to become available/visible and then continue your login process.
Also, avoid using Sleep() / setTimeout() approach to tackle waitings. It's just wrong and it's a problem waiting to materialize itself, as soon as you change the environment in which your code is running. Use a proper waiting methods from your test framework and properly wait for those elements to become available.

Google REST API v3 - Revisions:list vs "Show more detailed revisions"

I need to get the detailed list of the revisions for a Google Document.
When using the Google API Explorer on:
GET https://www.googleapis.com/drive/v3/files/{fileId}/revisions
I get only the non-detailed list.
Which is the API to call (or the parameter to set) in order to get something similar to what can be seen by pressing Show more detailed revisions?
Update:
I tried to "sniff" the browser traffic and I realized that Google Drive periodically requests the revision list to the URL:
https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=0&token={token}
When clicking on Show more detailed revisions, the previous URL becomes:
https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=1&token={token}
(the zoom_level parameter changes from 0 to 1)
I cannot find anything like that on the API reference, though. It seems that such an URL has to be invoked manually.
Therefore, I manually generated a token for the drive scope, manually checked it in order to keep it fresh and manually invoked that URL, in order to see what happened. Unfortunately, I got the following error on the browser:
Impossibile aprire il file in questo momento.
Verifica l'indirizzo e riprova.
which roughly means:
Unable to open the file at the moment.
Please verify the address and try again.
May somebody point me towards the right direction?
In the "Try it" section of the API there is a field called "fields". In there you can select the files you need from the response. If you write "kind,revisions" you will get the complete information or you can use the "fields editor" to select the fields you need.

new server/website appears to be caching but cache is turned off

I recently setup a home server running windows 7 pro and IIS 7.5. I have an ASP page that reads/writes to a database. One scenario I have is a newsletter with a list of subscribers. I manually check a box next to a user's name and they get added to a table that associates that userid with a messageid.
When the page loads initially, let's say I've previously added a user to the newsletter. I have a variable that displays that says "1 subscriber". If I add a user (by checking a box next to their name, hitting submit and submitting a form to the same page but with an action=submit added) the user entry will be added to the DB, the script file then redirects to the same page without the action=submit and Session("msg") will show as "updated successfully" but the subscriber count will equal 1 still. If I hit F5, the number updates.
Everything I've read along with what knowledge I have of programming points to it being a caching issue. However, I've taken all the steps I can find online to disable all caching.
Is there something I might be missing or might it not be a caching issue at all but rather something else? I've used this style of programming for years on other servers without any issues which is why I feel like it points to a setting somewhere.
This is the first server, I've been the admin for so I'm kinda bumbling my way through these things as they come up.
subscribers.asp?cid=5
polls DB to pull count of number of subscribers (audience)
[subscribers show 1]
polls DB to pull all email addresses in DB (subscribers)
list available email address within form
I check appropriate checkboxes next to name(s) and submit form
form submits to subscribers.asp?cid=5 with hidden input type name=action value=submit
Script runs (if action=submit then)
insert subscriber ids into audience table
set RS and Conn = Nothing
response.redirect(subscribers.asp?cid=5)
GOTO TOP
subscribers still show as 1. Hit F5, now it shows incremented appropriately.
Any help is greatly appreciated!

Resources