Thursday, 2 December 2021

Important air commands - Part 1

 1) air tag diff - 

->air tag diff -show-all tag1 tag2 (-show-all -optional list objects for which there are no differences)


2) air tag create -

-> air tag create {[-project-only]]

 | [-all-required] | [-exact]}  [-dry-run] [-move | -add] [-exact] [-strict] [-full-commons | -no-full-commons ]

 [-comment comment] [-rtag {rtag_name | version }] tag_name rpath | -file object-list

ex - To tag the Join customer graph and its required objects with the tag mytag-2021-11-23:

air tag create mytag-2021-11-23 /projects/lesson/mp/Joincustomer.mp


If you want to tag only the specified object without its required objects - use the -exact option ->

air tag create -exact mytag-2021-11-23 /projects/lesson/mp/Joincustomer.mp


If you want to tag the earlier version of Joincustomer.mp i.e 209 (current version is 309 ) - >

air tag create -rtag 209 tag-old-version /projects/lesson/mp/Joincustomer.mp

Note - if you want to tag a project or directory, all objects in the directory and its subdirectory are also tagged.

To ensure that your tag contains all the objects required by the primary object, specify the -strict option of the air tag crate command. By default the command flags warning when it encounters problems, such as missing or syntactically incorrect record format .dml file.


If you want to see the required objects before tagging them run air project get -required-files

air project get-required-files /projects/lesson/mp/unload-B-tables.mp

o/p - /projects/lesson db/transcations.cfg

      /projects/lesson db/customers.cfg

      /projects/lesson xfr/cust_trans_join.xfr


Adding objects to an existing Tag - 

air tag create -projects-only -add  -comment  "ädding 2nd graph" mytag-2021-11-23 /Projects/lesson/mp/loadjoinedcustomers.mp

View Tag cotent(mp,xfr,db,dml) -air tag list -e mytag-2021-11-23 (-e is everthing)

primary objecs of tag (mp not all the objects related to the mp,) - air tag list -p  tag (where -p is primary)


3) air object changed -

->air object changed [rpath] [-root1 eme1] [-branch1 branch1] [-version1 v1| tag1] 

[-root2 eme2] [-branch2 branch2] [-version2 v2| tag2] 

[-show-all]

[-tagged-only]

[-diff]


To find the diff between datastore version 4849 and the latest version of the same datastore and branch - air object changed /Projects/myproject -version1 4849


diff between the latest version of the myproj project on two different branches in the same datastore -release -200211123 and main ->

air object changed /Projects/myproj -branch1 release-200211123 -branch2 main


diff between the objects in the tag mytag and the same objects of the latest version - 

air object changed -veriosn1 mytag 


5) air project import - 

-> air project import project-path 

-basedir basedir

 [-dry-run]

 [-files relative path] 

[-find-required-files]

[-tag tag_name]

[-comment]


6) air project export -

->air project export project-path

-basedir sandbox-root-dir

[-dry-run]

[-force]

[-find-required-files]

[-required-common-file] 

[-files relative-path]

[-from-tag tag]

[-set parm-name value]

[-common common-rpath common-sandbox]

[-exclude project]


7) Display the diff between two graphs,plans or two text file 

air sandbox diff /u/jdoe/sand/mp/graph1.mp /u/jdoe/sand2/mp/graph2.mp


Wednesday, 1 December 2021

LOOKUP FILE plus REFORAMT - or JOIN ?

 You may sometimes need to merge a large dataset with a small one. You can easily do this using either a JOIN or a "lookup plus reformat".The lookup file approach may run faster because lookup files are stored in memory .To use the "lookup plus reformat"you place a LOOKUP FILE component plus a REFORMAt component in a graph.


When "lookup plus reformat" is better than Join?

use "lookup plus reformat" to merge datasets when :

All but one of the inputs are small enough to fit into memory.

The joining expression is complex and uses several lookup tables.

The joining expression involves intervals or pattern matching.

The lookup file will not grow significantly over time(If the memory limits are exceeded with a lookup file, the graphs fails.)


When is a JOIN better than "lookup plus reformat"?

Use a JOIN component to merge data set when :

You need to make the graph easy to read and understand.

You need to perform a full outer join or semi-join.

The lookup file may grow significantly over time.

One of your non-driving inputs is too large to fit into memory.

The driving parameter specifies the port where the largest input is; the parameter is available only when the sorted-input is set to in memory;Input need not be sorted.The driving  input flows over other input records without being sorted .All other inputs records are read into memory.

For an in-memory join, the component loads into memory as much of the non-driving input fiut as can (per the max-core parameter) .what doesn't fit  into memory is landed to disk .(This may be ok if you'd rather pay the cost in disk space instead of memory.)





how to create dml dynamically in Ab-initio

 $[ begin let int i = 0; let string(int) complete_list = "emp_nm,billable,age,designation,location"; let string(int) file_content ...