[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-12-07 Thread Flink Jira Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-20936:
---
  Labels: auto-deprioritized-major auto-deprioritized-minor  (was: 
auto-deprioritized-major stale-minor)
Priority: Not a Priority  (was: Minor)

This issue was labeled "stale-minor" 7 days ago and has not received any 
updates so it is being deprioritized. If this ticket is actually Minor, please 
raise the priority and ask a committer to assign you the issue or revive the 
public discussion.


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Not a Priority
>  Labels: auto-deprioritized-major, auto-deprioritized-minor
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
> {code}
>   Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class);
> return (PartitionTimeExtractor) 
> declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-11-29 Thread Flink Jira Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-20936:
---
Labels: auto-deprioritized-major stale-minor  (was: 
auto-deprioritized-major)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help 
the community manage its development. I see this issues has been marked as 
Minor but is unassigned and neither itself nor its Sub-Tasks have been updated 
for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is 
still Minor, please either assign yourself or give an update. Afterwards, 
please remove the label or in 7 days the issue will be deprioritized.


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Minor
>  Labels: auto-deprioritized-major, stale-minor
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
> {code}
>   Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class);
> return (PartitionTimeExtractor) 
> declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-04-29 Thread Flink Jira Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-20936:
---
Labels: auto-deprioritized-major  (was: stale-major)

>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>  Labels: auto-deprioritized-major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
> {code}
>   Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class);
> return (PartitionTimeExtractor) 
> declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-04-29 Thread Flink Jira Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-20936:
---
Priority: Minor  (was: Major)

>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Minor
>  Labels: auto-deprioritized-major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
> {code}
>   Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class);
> return (PartitionTimeExtractor) 
> declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-04-22 Thread Flink Jira Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-20936:
---
Labels: stale-major  (was: )

>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>  Labels: stale-major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
> {code}
>   Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class);
> return (PartitionTimeExtractor) 
> declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-12 Thread zhoukui (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhoukui updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:
{code:java}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

{code}
  Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class);

return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:
{code:java}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

{code}
  Would it be more reasonable to bring a parameter construction method? as 
follows:

try { Class aClass = userClassLoader.loadClass(extractorClass); 
Constructor declaredConstructor = 
aClass.getDeclaredConstructor(String.class); return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern); } catch 
(ClassNotFoundException | IllegalAccessException | InstantiationException | 
NoSuchMethodException | InvocationTargetException e) { throw new 
RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for cus

[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-12 Thread zhoukui (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhoukui updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:
{code:java}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

{code}
  Would it be more reasonable to bring a parameter construction method? as 
follows:

try { Class aClass = userClassLoader.loadClass(extractorClass); 
Constructor declaredConstructor = 
aClass.getDeclaredConstructor(String.class); return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern); } catch 
(ClassNotFoundException | IllegalAccessException | InstantiationException | 
NoSuchMethodException | InvocationTargetException e) { throw new 
RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

{code}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }
{code}
 


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code:java}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custo

[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-12 Thread Jark Wu (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jark Wu updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

{{code}}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }
{{code}}
 

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

 


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {{code}}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from 

[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-12 Thread Jark Wu (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jark Wu updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

{code}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }
{code}
 

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

{{code}}
@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }
{{code}}
 


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> {code}
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom 

[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-11 Thread zhoukui (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhoukui updated FLINK-20936:

Priority: Major  (was: Minor)

>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Major
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
>  
> Would it be more reasonable to bring a parameter construction method? as 
> follows:
> try
> { Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
> declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
> (PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException | NoSuchMethodException | InvocationTargetException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-11 Thread zhoukui (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhoukui updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a parameter construction method? as 
follows:

try

{ Class aClass = userClassLoader.loadClass(extractorClass); Constructor 
declaredConstructor = aClass.getDeclaredConstructor(String.class); return 
(PartitionTimeExtractor) declaredConstructor.newInstance(extractorPattern); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
| NoSuchMethodException | InvocationTargetException e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

 

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a construction method? as follows:

try {
 Class aClass = userClassLoader.loadClass(extractorClass);
 Constructor declaredConstructor = 
aClass.getDeclaredConstructor(String.class);
 return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern);
} catch (ClassNotFoundException | IllegalAccessException | 
InstantiationException | NoSuchMethodException | InvocationTargetException e) {
 throw new RuntimeException(
 "Can not new instance for custom class from " + extractorClass, e);
}

 


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Minor
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default

[jira] [Updated] (FLINK-20936) Improvements in custom partition extractor

2021-01-11 Thread zhoukui (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-20936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhoukui updated FLINK-20936:

Description: 
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

@Experimental
 public interface PartitionTimeExtractor extends Serializable {

String DEFAULT = "default";
 String CUSTOM = "custom";

/**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try

{ Class aClass = userClassLoader.loadClass(extractorClass); return 
(PartitionTimeExtractor) aClass.newInstance(); }

catch (ClassNotFoundException | IllegalAccessException | InstantiationException 
e)

{ throw new RuntimeException( "Can not new instance for custom class from " + 
extractorClass, e); }

default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
 }

 

Would it be more reasonable to bring a construction method? as follows:

try {
 Class aClass = userClassLoader.loadClass(extractorClass);
 Constructor declaredConstructor = 
aClass.getDeclaredConstructor(String.class);
 return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern);
} catch (ClassNotFoundException | IllegalAccessException | 
InstantiationException | NoSuchMethodException | InvocationTargetException e) {
 throw new RuntimeException(
 "Can not new instance for custom class from " + extractorClass, e);
}

 

  was:
In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
parameters, why not take the parameter “extractorPattern". See the source code 
below:

@Experimental
public interface PartitionTimeExtractor extends Serializable {

 String DEFAULT = "default";
 String CUSTOM = "custom";

 /**
 * Extract time from partition keys and values.
 */
 LocalDateTime extract(List partitionKeys, List 
partitionValues);

 static PartitionTimeExtractor create(
 ClassLoader userClassLoader,
 String extractorKind,
 String extractorClass,
 String extractorPattern) {
 switch (extractorKind) {
 case DEFAULT:
 return new DefaultPartTimeExtractor(extractorPattern);
 case CUSTOM:
 try {
 Class aClass = userClassLoader.loadClass(extractorClass);
 return (PartitionTimeExtractor) aClass.newInstance();
 } catch (ClassNotFoundException | IllegalAccessException | 
InstantiationException e) {
 throw new RuntimeException(
 "Can not new instance for custom class from " + extractorClass, e);
 }
 default:
 throw new UnsupportedOperationException(
 "Unsupported extractor kind: " + extractorKind);
 }
 }
}

 

Would it be more reasonable to bring a construction method? as follows:

Constructor declaredConstructor = 
aClass.getDeclaredConstructor(String.class);
return (PartitionTimeExtractor) 
declaredConstructor.newInstance(extractorPattern);

 


>  Improvements in custom partition extractor
> ---
>
> Key: FLINK-20936
> URL: https://issues.apache.org/jira/browse/FLINK-20936
> Project: Flink
>  Issue Type: Improvement
>  Components: Connectors / Hive
>Affects Versions: 1.12.0
> Environment: flink 1.12.0
> jdk 1.8
>Reporter: zhoukui
>Priority: Minor
>
> In flink1.12.0, I saw PartitionTimeExtractor is a constructor without 
> parameters, why not take the parameter “extractorPattern". See the source 
> code below:
> @Experimental
>  public interface PartitionTimeExtractor extends Serializable {
> String DEFAULT = "default";
>  String CUSTOM = "custom";
> /**
>  * Extract time from partition keys and values.
>  */
>  LocalDateTime extract(List partitionKeys, List 
> partitionValues);
> static PartitionTimeExtractor create(
>  ClassLoader userClassLoader,
>  String extractorKind,
>  String extractorClass,
>  String extractorPattern) {
>  switch (extractorKind) {
>  case DEFAULT:
>  return new DefaultPartTimeExtractor(extractorPattern);
>  case CUSTOM:
>  try
> { Class aClass = userClassLoader.loadClass(extractorClass); return 
> (PartitionTimeExtractor) aClass.newInstance(); }
> catch (ClassNotFoundException | IllegalAccessException | 
> InstantiationException e)
> { throw new RuntimeException( "Can not new instance for custom class from " + 
> extractorClass, e); }
> default:
>  throw new UnsupportedOperationException(
>  "Unsupported extractor kind: " + extractorKind);
>  }
>  }
>  }
>  
> Would it be more reasonable to bring a construction method? as follows:
> try {
>  Class aClass = userClassLoader.loadClass(extractorClass);
>  Constructor declaredConstructor = 
> aClass.getDecla