Created 07-14-2017 06:04 PM
Im using HDP 2.6 and I'm trying to use DSL to query Atlas for tables created after a certain date. So far, I've tried querying based on the attribute "createTime" but am unable to figure out the date format used (milliseconds, seconds, etc...). It seems that it only takes year (>2017, <2018) but nothing more.
Does anyone have any idea how to query for tables created/modified after a certain date/time?
Created 07-14-2017 06:43 PM
You can query using the API for entities created/modified after a certain date. You would do this by running a DSL query against the “createTime” attribute via rest.
For example, if you would like to query for hive tables created/modified after 2017-04-18 6:49pm Your rest call would look like:
http://localhost:21000/api/atlas/v2/search/dsl?query=createTime%3E'2017-04-18T18%3A49%3A44.000Z'&typeName=hive_table
The date format is as follows:
{yyyy}-{mm}-{dd}T{hh}:{mm}:{ss}.{zzz}Z
{year}-{month}-{day}T{hours}:{minutes}:{seconds}.{timezone}Z
e.g. 2017-04-18T18:49:44.000Z
You can also use a subset of the date rather than the entire string. For example you can query by year only (2017), full date only (2017-04-18), date and time only (2017-04-18T18:49:44)
Created 07-14-2017 06:43 PM
You can query using the API for entities created/modified after a certain date. You would do this by running a DSL query against the “createTime” attribute via rest.
For example, if you would like to query for hive tables created/modified after 2017-04-18 6:49pm Your rest call would look like:
http://localhost:21000/api/atlas/v2/search/dsl?query=createTime%3E'2017-04-18T18%3A49%3A44.000Z'&typeName=hive_table
The date format is as follows:
{yyyy}-{mm}-{dd}T{hh}:{mm}:{ss}.{zzz}Z
{year}-{month}-{day}T{hours}:{minutes}:{seconds}.{timezone}Z
e.g. 2017-04-18T18:49:44.000Z
You can also use a subset of the date rather than the entire string. For example you can query by year only (2017), full date only (2017-04-18), date and time only (2017-04-18T18:49:44)
Created 03-26-2018 10:15 AM
Above DSL Search query is working for creating time only , Its not working for Modified Time
Find below query with modified time , Its not working
http://localhost:21000/api/atlas/v2/search/dsl?query=modifiedTime%3E'2017-08-02T16%3A33%3A23.408Z'&typeName=hive_table
Please help on this..!!!