Question: I'm trying to change the date format of my data from (11 20, 2014) to 2014-11-20.
I tried this:

```
df.withColumn("newDate", to_date(col("reviewTime"),("mm dd, yyyy")))

```

Because the days with single digits appear as 1,2,8 instead of 01,02,08 I got this message:

SparkUpgradeException: You may get a different result due to the upgrading of Spark 3.0: Fail to parse '09 1, 2014' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string.
Caused by: DateTimeParseException: Text '09 1, 2014' could not be parsed at index 3

Is there a way to fix this?

Thanks!

Answer: 
You can wrap the function in a macro, and use the preprocessor to get the variable name as a string.

```
#include <iostream>
#include <string>

#define printArray(x, y) printArrayElements((#x), x, y)

void printArrayElements(std::string name, int num[], int size){
    std::cout << "Array name: " << name << std::endl;
    for(int i=0;i<size;i++){
        std::cout << "Array elements: " << num[i] << std::endl;
    }
    std::cout << std::endl;
}

int main() {
    int test[5] = {1,2,3,4,5};
    int cool[10] = {4,1,2,4,5,3,7,4,2,7};

    printArray(test, 5);
    printArray(cool, 10);
}

```
This is not possible with vanilla C++ at the moment, but you can use the preprocesser to do it:

```
#define PRINTNAME(name) (std::cout << "name" << ":" << (#name) << std::endl)

```