How to query on hbase json string value - hadoop

I am saving list of data as below in hbase with unique id along with column family name :
I can query on address column family with specific id but I want to query on the json value like
where homenumber = 4
Can we do that? Any example will be helpful
Thanks

You can use HBase filter for this. Find the possible duplicate questions
Scan with filter using HBase shell
Scan HTable rows for specific column value using HBase shell
To start working with HBase filter, refer
http://hbase.apache.org/0.94/book/client.filter.html
http://www.hadooptpoint.org/filters-in-hbase-shell/

Related

How to search using Table API

I want to figure out how to search a table's field for a keyword and return the rows that match. i.e. search for the word apple in the description field on a post table.
https://docs.servicenow.com/bundle/newyork-application-development/page/integrate/inbound-rest/concept/c_TableAPI.html#r_TableAPI-GET
If you are using ServiceNow TABLE API to fetch results then you could the following on any column of any table. All you need to do is to use sysparm_query parameter with CONTAINS keyword on the column that you are trying to search.
For example:
I want to fetch all the incidents that contains unable to connect string in the descriptions.
https://myinstance.service-now.com/api/now/v2/table/incident?sysparm_query=descriptionCONTAINSunable+to+connect
It returned all the incidents records that contains unable to connect string in there descriptions.

Perfom get query with value other than key

Is it possible for me to use the get query to query for a value other than the primary key? Cuz it seems I can only pass in the id column but is there no way in which i could perform the get query with a column other than the id column.
Or can I just do this with a normal list query using maybe a filter or something? Thanks for any help!
Yes you can issue any DynamoDB query through AppSync. This provides a good introduction that covers PutItem, UpdateItem, and GetItem https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-resolvers.html. If you need to get multiple values by a key then you should use the DynamoDB Query operation https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-dynamodb.html#aws-appsync-resolver-mapping-template-reference-dynamodb-query.
When using DynamoDB you need to bake your access patterns into the key schema(s) of your DynamoDB table and secondary indexes. For example, if you want to get a record by "email" then you should create a table where the hash key is "email". You would then be able to perform a GetItem operation by "email". If you need to query by email and have records sorted by date, then you would need a table where the hash key is "email" and the sort key is "date". Etc..
You are able to create secondary indexes and if you want to get a bit more advanced create composite index values and overload indexes to optimize your DynamoDB tables for your access patterns. Checkout the DynamoDB docs to learn more https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-indexes.html.

Insert UUID data type values in Cassandra Database Using Apache Metamodel

I want to insert UUID type values in Cassandra database using Apache Metamodel. For text data type I am using like
.values("ColName", value)
How can I insert UUID type values?
This SO question says it should look something like
.values(colName, 77820258-ef49-4e61-8a74-debbdd5993ea)
if you have a hardcoded UUID. This gives various ways you can auto-generate a UUID.

Getting results from Hbase table using "like" like functionality

I am trying to get all row keys which match a particular pattern from Hbase table. The rowkey are present in a particular format as abc:def:ghi.
I am trying to write a java code which would get me all row keys starting with "abc". If any one can give me some idea , by using filter or any other method we can obtain the same . That would be very grateful.
Thanks
Ashit

Representing summary data in a Kibana Data Table

Using Kibana, is it possible to display one row of data which is a summary of other rows?
This is our requirement:
Given an entry in an index with the following structure:
string requestId
boolean raisedException
boolean requiredExternalLookup
We want to create a tabular output with the following structure
requestId numberRaisedException numberNoException numberRequiredLookup
So, if there were three rows (or entries) in the index for the same request id, two where an exception was raised, the output may look like this:
requestId numberRaisedException numberNoException numberRequiredLookup
REQUEST_123 2 1 3
Presumably the correct Kibana visualization widget to represent this would be a Data Table. But how in Kibana would one create a row like the above which is a summary of several rows, somewhat akin to a sql GROUP BY clause. Is it at all possible?
You can probably do this with 'scripted_fields', but the status of the 'scripted_fields' feature in kibana isn't clear. I think it was recently blocked in kibana due to security issues - Leaving this open is dangerous since you can do anything.
If you have access to your elasticsearch cluster then you might be able to create the field on your elasticsearch index.
You can read about it here : http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html

Resources