Will U-SQL support preprocessor like Local and external parameter(##) - azure-data-lake

Scope support preprocessor LOCAL and external parameter, I found it is very useful, but I couldn't find them in U-SQL.
Thanks.

While U-SQL evolved from SCOPE, there are many language feature differences. One of them is that we removed the preprocessing step that SCOPE had for security reasons (SQL-injection attacks).
U-SQL provides external parameters using the standard parameter/variable naming, e.g., #parameter. You can even default an external parameter (and document it in your script) with
DECLARE EXTERNAL #parameter = "default";

Related

Use expressions instead of variables in azure devops

In azure devops, inside the classic build, I can generally do $(myVar) to get the value of a variable in certain places. I am not sure if that particular usage has a name.
Is there a way to pass an expression for the same use cases. I mean instead of $(myVar) can I do something like $(coalesce(myVar, otherVar))?
I have tried wrapping it in different brackets, doesn't seem to work.
I have checked the docs here: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops
It doesn't show how to use in the classic pipelines, only yaml.
Is there a way to pass an expression for the same use cases. I mean instead of $(myVar) can I do something like $(coalesce(myVar,
otherVar))?
Agree with Daniel, the common use of Expressions is to define conditions for a step, job, or stage or define variables. The expressions work well in Yaml pipelines while it's not supported in Classic pipelines if you want to define variables using $(coalesce(myVar, otherVar)) instead of $(myVar).
The $(coalesce(...))is one of the built-in functions. The only working scope of those functions in classic pipelines is conditions for Job/Task, see:
Job:
Task:
But it seems you're trying to use built-in functions when defining variables, for now that's not supported in classic pipelines. Those can only be used to define/control the conditions for job/task in classic pipelines.
Expressions as outlined in the documentation you linked only apply to YAML. You won't be able to do what you want to do unless you use YAML.
While using expressions in classic pipelines is not supported (except in the control section of the task), I've had success defining a release variable with the expression, and using that release variable instead.
In my case I wanted to do releases based on git tags, and extract the version number from the tag.
Variable definition (with the expression I want to use):
Using the variable in the task:

Can we do variable substitution on YAML files in IntelliJ?

I am using IntelliJ to develop Java applications which uses YAML files for the app properties. These YAML files have some placeholder/template params like:
credentials:
clientId: ${client.id}
secretKey: ${secret.key}
My CI/CD pipeline takes care of substituting the actual value for these params (client.id and secret.key) based on the environment on which it is getting deployed.
I'm looking for something similar in IntelliJ. Something like, I configure some static/fixed values for the params (Ex: client.id and secret.key) within the IDE and when I run locally using the IDE, these values should be substituted onto these YAML files and run.
This will actually save me from updating the YAML files with the placeholder params each time I check in some other changes to my version control system.
There is no such feature in IDEA, because IDEA cannot auto detect every possible known or unknown expression language or template macros that you could use in a yaml file. Furthermore, IDEA must create a context for that or these template files.
For IDEA it's just a normal yaml file.
IDEA has a language injection feature.
That can be used to inject sql into a java string for instance or inject any language into a yaml field.
This is a really nice feature and can help you to rename sql column names aso. but this won't solve your special problem, because you want to make that template "runnable" within in certain context where you define your variables.
My suggestion would be, to write a small simple program that makes nearly the same as the template engine does.
When you only need simple string replacements and no macro execution then this could be done via regular expression.
If it's more complicated I would use the same template engine as the "real processor" does.
If you want further help, it would be good to know how your yaml processing pipeline looks like.

How to set custom name, suffix for mapper files and interfaces in mybatis generator?

Can you set custom suffix and naming rule mapper xml and interfaces in MyBatis Generator (MBG)?
For example, When generating mapper files for class Book. MBG generates mapper file BookMapper.xml and interface PartnerDao.java. However, I wish to change the suffix to something else, like BookMapperBase.xml or BookDaoBase.xml, and PartnerMapperBase.java or PartnerDaoBase.java.
The reason is, former colleagues were using BookMapper.xml for their hand-written sql statements and using the same name would cause confusion. Moreover, I do not wish to use generated mappers directly, but use custom mapper files that extend BookMapperBase.xml.
I have searched online and found some github projects and hot rod ORM, but is it really not supported by official Mybatis Generator? If not, what is your recommended alternative?
There are a couple of options.
You could use a domain object renaming rule as documented here: http://www.mybatis.org/generator/configreference/domainObjectRenamingRule.html
If that doesn't work the way you want it to, you could write a MyBatis Generator plugin to change the names of the generated artifacts. There is an example here: https://github.com/mybatis/generator/blob/master/core/mybatis-generator-core/src/main/java/org/mybatis/generator/plugins/RenameExampleClassPlugin.java

How to use Oracle's dbms_standard package

How does one use the dbms_standard package from Oracle? (Version 10g)
It's not described in the document PL/SQL Packages and Types Reference 10g Release 2 (10.2) B14258-02.
Oracle doesn't document it, because Oracle doesn't intend for its functionality to be directly used. This is the basic definitions for the SQL environment. You will see type definitions such as FLOAT, REAL, INTEGER, CHAR, etc. in here. Here is where functions that implement language features like SQLERRM are defined.
Why wouldn't they provide documentation for those that want it? Because Oracle wants and needs to be able to change this stuff at will, from release to release. They don't want to have any responsibility for applications that make use of the features in here when they break because Oracle needed to change something. Providing documentation encourages its use.
EDIT:
For the curious, you can take a peek at %ORACLE_HOME%\RDBMS\Admin\stdspec.sql (package spec) and stdbody.sql (package body), which are executed by the standard.sql script. WARNING: don't modify them! These files are in the RDBMS server Oracle home, not the client home.

Tool to Identifying Global Variables in VB.NET

Is there an automated tool for VB.Net that will identify all global variables in a project?
Short of that, is there any scripts that can be used that will facilitate a manual review of global variables?
There seems to be tools for C/C++, but not for VB.Net:
Tools to find global/static variables in C codebase
Is there a tool to list global variables used and output by a C function?
EDIT:
My current approach uses the following VS REGEX searches:
For finding global variables:
~(Private:b+)Shared:b+:i:b+As:b+
For finding global properties:
~(Private:b+)Shared:b+(~(ReadOnly:b+):i:b+)#Property:b+:i([(][)]|[]):b+As:b+
fxCop might help, but you might need to write a plugin for that particular function.
Also, ndepend (Using the CQL "code query langauge") I'm pretty sure will give you a report or globals (and a whole lot more).
What are you calling a "global variable"? a variable defined as Shared (private or otherwise) isn't 'global' at all.
Really, the only 'global' variables left in vb.net are declared as public in a module